Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tags

Status
Not open for further replies.

JayKappy

Technical User
Mar 23, 2007
29
US

I have an XSL file that I am using to output to XML....

Thanks to the help from k5tm....

The below example creates tags <tr> and <td>
<tr>
<td><xsl:value-of select="Title"/></td>
<td><xsl:value-of select="Description"/></td>
</tr>

But I need my tags to read
<item>
<title><xsl:value-of select="Title"/></title>
<description><xsl:value-of select="Description"/></description>
</item>

I can change them fine and the out put still works, although everything is placed on the same line. I cannot have the <tr> and <td> in my output because it will not work with the other application.
Is there a way to force a return, or start a new line?

THanks again this is a great forum....very helpful
 
One more thing...I swear this will be it for a while....

I need to tag something

<geo:lat> </geo:lat>

But it seems to be bombing out on the : how do I get around this?

 
For your first question: Use the <xsl:eek:utput> element, specifically:
Code:
<xsl:output indent="yes"/>
xsl:eek:utput is a top-level element, so place it immediately subordinate to your xsl:stylesheet element.

For your second question:
Code your namespace alias (i.e. the thing that defines geo) in your stylesheet element:
Code:
<xsl:stylesheet xmlns:geo="[URL unfurl="true"]http://www.w3.org/2003/01/geo/wgs84_pos#">[/URL]

Tom Morrison
 

Please refer to this forum entry for these answers

XML Output Templates

Thank you all for your help.....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top