Subject: Re: [xsl] Newline problems|
From: "Vishwajit Pantvaidya" <pantvaidya@xxxxxxxxxxx>
Date: Tue, 06 May 2003 13:56:19 -0700
From: Mike Brown <mike@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Newline problems Date: Tue, 6 May 2003 09:09:23 -0600 (MDT)
Vishwajit Pantvaidya wrote:
> Here just to explain, I am inserting a simplified version of the original
> xml and xsl:
> <atomicValue>PO BOX 1234</atomicValue>
> <atomicValue>MEDICAL CENTER</atomicValue>
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:transform xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version =
> <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:template mode = "Attribs" match = "attribute">
> <xsl:element name="BILL_TO_ADDRESS2">
> <xsl:value-of select="attribute/atomicValue[../name='BILL_TO_ADDRESS2']"/>
> <xsl:element name="PO_NUMBER">
> <xsl:value-of select="attribute/atomicValue[../name='PO_NUMBER']"/>
> 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.
I will see that? I don't recall seeing what the desired output XML was.
In all your posts in this thread, you have not stated what you're trying
to produce. It is very hard for anyone to help you under these circumstances.
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE Order> <Order> <Info> <BILL_TO_ADDRESS2>PO BOX 1234</BILL_TO_ADDRESS2> <PO_NUMBER>123456</PO_NUMBER> </Info> </Order>
> 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?