[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

More newbie questions

Subject: More newbie questions
From: mylistaddress@xxxxxxxxxx
Date: Mon, 21 Mar 2005 18:51:39 -0800 (PST)
xsl record number
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
&lt;b&gt;big&lt;/b&gt; 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
&lt;b&gt;big&lt;/b&gt; 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.