Hi,
I have a number of questions which once again I am not
quite sure how to ask, but here it goes.
Here is a sample of some XML I need to deal with:
<Root>
<Database DatabaseName="2004DATA" />
<Response>
<Record number="1">
<Field FieldName="DOCID">SAP1234</Field>
<Field FieldName="COUNTRY">USA</Field>
<Field FieldName="CITY">Baltimore</Field>
<Field FieldName="TEXT">Baltimore is a
<b>big</b> city...</Field>
</Record>
<Record number="2">
<Field FieldName="DOCID">XYZ4433</Field>
<Field FieldName="COUNTRY">Canada</Field>
<Field FieldName="CITY">Toronto, Montreal</Field>
<Field FieldName="TEXT">Toronto and Montreal are in
Canada</Field>
</Record>
<Record number="3">
<Field FieldName="DOCID">ABC123</Field>
<Field FieldName="COUNTRY">Sweden</Field>
<Field FieldName="CITY">Stockholm</Field>
<Field FieldName="TEXT">Stockholm is a
<b>big</b> city also...</Field>
</Record>
<Response>
</Root>
1- My first issue concerns the Database tag. As you can
see, I receive an XML response with 1 response and
multiple Records nested within it. I need to
extract each "Record" and transform it to be different
XML (no attribute names for one thing...), and I need
to add the value in the Database tag (2004DATA) to each
"Record" before inserting the doc as a CLOB into a
database. The problem is, my limited xsl skills have
allowed me to extract the data I need, but I can't
figure out how to get the database name value into each
record. I tried assigning the value to a variable with
xsl:variable, but the transformation fails. Any help
appreciated...
2- How would I create multiple CITY tags in the output
when faced with a response like that in record # 2,
where the value is Toronto, Montreal? I don't want a
comma separated value in the body of the tag.
3- You may have noticed the escaped angle brackets for
the HTML tags in the TEXT tag value. How do I have them
display properly? I played with the output="html" and
the escape attribute to no avail.
Sorry to drop so many questions. Any help is greatly
appreciated.
JW
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--