Skip to Content
author's profile photo Former Member
Former Member

XSLT Mapping and Namespace Issues

I have been reading through similar threads on this topic, but have not found the right combination for my problem. I am doing an XSLT map and it works fine in Stylus Studio. When I take it to PI, I get a "Prefix 'ns0' is not mapped to a namespace" error. I have a namespace that is within the XSD files I received from my partner (http://www.ups.com/XMLSchema/EBR/Billing/v1). I also have the namespace I made in PI for the source (http://graybar.com/upsbilling/) and a different namespace in PI for the destination (http://graybar.com/cold/invoice/).

<u><b>XSLT:</b></u>

<?xml version='1.0' encoding="UTF-8"?>

http://www.w3.org/1999/XSL/Transform" xmlns:ns0=" http://www.ups.com/XMLSchema/EBR/Billing/v1" xmlns:ns1=" http://graybar.com/cold/invoice/">

<xsl:template match="/">

<ns1:ColdInvoiceData>

<Header>

<RecordID>HDR</RecordID>

<InvoiceDate>

<xsl:value-of select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice/ns0:InvoiceDateCCYYMMDD"/>

</InvoiceDate>

...

<u><b>Source XML</b></u>

<?xml version="1.0" encoding="ISO-8859-1" ?>

http://www.w3.org/2001/XMLSchema-instance" xmlns=" http://www.ups.com/XMLSchema/EBR/Billing/v1" xsi:schemaLocation=" http://www.ups.com/XMLSchema/EBR/Billing/v1 Billing_XML_Schema.xsd">

<XMLBillFileVersion>1.0.1</XMLBillFileVersion>

<Recipient>

...

When I change the XSLT namespace from http://www.ups.com/XMLSchema/EBR/Billing/v1 to http://graybar.com/upsbilling/, the TransfromerException in PI goes away, but none of my referenced mappings work either (just my text hardcodes).

Can someone tell me why this works in Stylus Studio, but not in PI? Do I have too many namespaces?

Message was edited by:

Keith Wendel (to uncomment xsl:stylesheet line)

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 30, 2007 at 09:47 AM

    Would this work:

    ...
    <ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice/">
    <Header>
    <RecordID>HDR</RecordID>
    <InvoiceDate>
    <xsl:value-of select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice/ns0:InvoiceDateCCYYMMDD"/>
    </InvoiceDate>
    ...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 02:48 PM

    Ignore the beginning comment mark. That was a copy/paste issue. I will go edit it. I have yet to try Stefan's recommendation.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 04:41 PM

    I am not sure change along the way helped, but now when I run a test in IB-Rep with real source data pasted in, the xslt mapping works. It still gives the ns0 error if I just test with the default structure.

    The other day, both were failing. My xsl is the same as above. Thanks everyone.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.