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

RE: Newline problems

Subject: RE: Newline problems
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Fri, 2 May 2003 15:34:26 -0500
xsl newline
> Thanks for your reply, Lars.
> Actually, my entire output xml is empty, meaning most element 
> tags exist 
> without any values in the output xml.

Hmm, so there is output, but it consists of empty elements.
I understand better now... that fits exactly with what you thought,
that the values of the text nodes in your input document
differ from what you expected by having newlines on them.

> Here is the source xml and the xsl in more detail:
> ...
> ]><ABC>
> ...
> <info>
> <attr>
> <name>
> ponumber</name>
> <atomicValue>
> 12345</atomicValue>
> </attr>
> ...
> </info>
> ...
> </ABC>
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:transform xmlns:xsl = 
> "http://www.w3.org/1999/XSL/Transform" version = 
> "1.0">
> <xsl:template match = "ABC">
> <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE 
> OrderProcessing&gt;</xsl:text>
> <xsl:element name = "Order">
> <xsl:element name ="Info">
> <xsl:apply-templates mode = "Attribs" select = "/ABC/info"/>
> </xsl:element>
> </xsl:element>
> </xsl:template>
> ...
> <xsl:template mode = "Attribs" match = "info">
> <xsl:element name = "PO_NUMBER">
> <xsl:value-of select="attr/atomicValue[../name='ponumber']"/>

Yes, it makes sense that this element would not have a value in the output,
because as you suspected, the contents of attr/name is not 'ponumber' but '
ponumber'.  This can be cured with
<xsl:value-of select="attr/atomicValue[normalize-space(../name)='ponumber']"/>

> </xsl:element>
> ...
> </xsl:template>
> ...
> </xsl:transform>
> About your query about xsl-output doctype-public, our source 
> xml has an 
> inline DTD. I understand that doctype-public or system are to 
> be used if we 
> have an external DTD. Is that correct?

Yes, for the *output* document.
Sounds like your output document has an inline DTD too, in which
case never mind.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.