Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

xml Translation question

Options
  • 13-09-2010 4:31pm
    #1
    Registered Users Posts: 170 ✭✭


    Hi,

    I'm trying to use an xsl file to pick out some values from one cXML file and generate another xml file. I get the file created but the values are not being populated.

    Here's the file that i'm trying to translate.

    <cXML>
    <Request>
    <InvoiceDetailRequest>
    <InvoiceDetailRequestHeader invoiceID="123456"/>
    </InvoiceDetailRequest>
    </Request>
    </
    cXML>

    Using this xsl file

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
    <xsl:template match="/">
    <Invoice>
    <DocumentNumber>
    <xsl:value-of select="cMXL/Request/InvoiceDetailRequest/InvoiceDetailRequestHeader/invoiceID"/>
    </DocumentNumber>
    </Invoice>
    </xsl:template>
    </
    xsl:stylesheet>

    My output is this
    <?xml version="1.0" encoding="UTF-8"?>
    <Invoice>
    <DocumentNumber/>
    </
    Invoice>

    Does any one have any idea where I'm going wrong? I was hoping to get this output

    <?xml version="1.0" encoding="UTF-8"?>
    <Invoice>
    <DocumentNumber>123456</DocumentNumber>
    </
    Invoice>

    Thanks



Comments

Advertisement