Now I have a more complicated situation than I asked about in In XSLT for MODS XML to FilemakerPro conversion, how treat a mod with a parameter? . In the XML I'm trying to convert to FileMaker Pro format, I have:
<name type="personal">
<namePart type="family">
Giobbi
</namePart>
<namePart type="given">
Robert
</namePart>
<role>
<roleTerm authority="marcrelator" type="code">
aut
</roleTerm>
</role>
</name>
What do I put in the XSLT for the <xsl:value-of select="...." />
to handle that. The new complications are:
- The source XML has a nested structure with several elements inside
name
. - For item
roleTerm
there are two parametersauthority
andcode
.
In the resulting XML, I want separate columns for "family" and "given" names and for the roleTerm
.
Also, in some situations, there will be two or more such <name>...</name>
entities. How do I handle that -- so as to create additional columns in the target XML? Is it as simple as changing MAXREPEAT
from "1"
to a greater value?
The desired output should be something like the following:
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult"
xmlns:mod="http://www.loc.gov/mods/v3">
<ERRORCODE>0</ERRORCODE>
<PRODUCT NAME="N/A" BUILD="N/A" VERSION="N/A"/>
<DATABASE NAME="N/A" LAYOUT="N/A" RECORDS="1" DATEFORMAT="M/d/yyyy" TIMEFORMAT="h:mm:ss a"/>
<METADATA>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="Title"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="Genre"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="LastName"/>
<FIELD EMPTYOK="YES" MAXREPEAT="1" TYPE="TEXT" NAME="FirstName"/>
</METADATA>
<RESULTSET>
<ROW MODID="1" RECORDID="1">
<COL>
<DATA>Roberto Giobbi's Card college. Volume 1</DATA>
</COL>
<COL>
<DATA>book</DATA>
</COL>
<COL>
<DATA>Giobbi</DATA>
</COL>
<COL>
<DATA>Roberto</DATA>
</COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
I say "something like" that because of course there will be more rows, one for each item in the source XML, and more importantly because I don't know what the result should look like when there is more than one field of the form <name type="personal">...</name>
in the source (.e., multiple authors in the bibliographic source xml file).