|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Newline problems
Mike - thanks for persisting so long with me.
From: Mike Brown <mike@xxxxxxxx> Date: Mon, 5 May 2003 18:31:43 -0600 (MDT) Here just to explain, I am inserting a simplified version of the original xml and xsl: <Quote> <Info> <attribute> <name> BILL_TO_ADDRESS3</name> <atomicValue>PO BOX 1234</atomicValue> </attribute> <attribute> <name> BILL_TO_ADDRESS2</name> <atomicValue>MEDICAL CENTER</atomicValue> </attribute> <attribute> <name> PO_NUMBER</name> <atomicValue>123456</atomicValue> </attribute> </Info> </Quote> <?xml version = "1.0" encoding = "UTF-8"?> <xsl:transform xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0"> <xsl:template match = "Quote"> <xsl:text disable-output-escaping="yes"><!DOCTYPE Order></xsl:text> <xsl:element name = "Order"> <xsl:element name ="Info"> <xsl:apply-templates mode = "Attribs" select = "/Quote/Info"/> </xsl:element> </xsl:element> </xsl:template>
I guess I could have used a common template to copy all name nodes and their atomicvalues to the output tree, but that would copy all attributes from the source in the output, which I do not want e.g. the above snippet excludes attribute with name BILL_TO_ADDRESS3 that is present in the source xml. Also you will see that I need only the atomicvalues in the output xml. So the way the logic gets to them is through the name nodes i.e. xsl:value-of select "the atomicvalue for the node whose name is 'BILL_TO_ADDRESS2'". It seems that the logic is failing as the processor finds that the values of the name nodes are '<newline>BILL_TO_ADDRESS2' which hence does not match. How can I achieve these objectives by using templates? Thanks, Vish. _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








