Skip to Content
0
Former Member
Nov 29, 2007 at 06:02 PM

XSLT Mapping and Namespace Issues

132 Views

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)