<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Transform XML to a different namespace prefix in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365215#M1993376</link>
    <description>&lt;P&gt;I had to add the other namespaces, so I've now got:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:n0="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:n1="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:n2="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:n3="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                version="2.0"&amp;gt;
&amp;lt;xsl:output encoding="UTF-8" indent="yes" method="xml"/&amp;gt;&lt;BR /&gt;  &amp;lt;xsl:strip-space elements="*"/&amp;gt;
  &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n0 to rsm --&amp;gt;
  &amp;lt;xsl:template match="n0:*"&amp;gt;
    &amp;lt;xsl:element name="rsm:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n1 to qdt --&amp;gt;
  &amp;lt;xsl:template match="n1:*"&amp;gt;
    &amp;lt;xsl:element name="qdt:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n2 to ram --&amp;gt;
  &amp;lt;xsl:template match="n2:*"&amp;gt;
    &amp;lt;xsl:element name="ram:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n3 to udt --&amp;gt;
  &amp;lt;xsl:template match="n3:*"&amp;gt;
    &amp;lt;xsl:element name="udt:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="text()"&amp;gt;
    &amp;lt;xsl:value-of select="."/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And it's nearly working! But for...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;n2:IssueDateTime&amp;gt;
	&amp;lt;n3:DateTimeString format="102"&amp;gt;20201117&amp;lt;/n3:DateTimeString&amp;gt;
&amp;lt;/n2:IssueDateTime&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ram:IssueDateTime&amp;gt;
	&amp;lt;udt:DateTimeString&amp;gt;20201117&amp;lt;/udt:DateTimeString&amp;gt;
&amp;lt;/ram:IssueDateTime&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So for some reason, the &lt;STRONG&gt;format &lt;/STRONG&gt;attribute is being lost.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 10:12:43 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2021-01-06T10:12:43Z</dc:date>
    <item>
      <title>Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365209#M1993370</link>
      <description>&lt;P&gt;I'm generating the XML for a ZUGFeRD document. It's all working great, except some validators are rejecting my XML due to the namespace prefix. &lt;/P&gt;
  &lt;P&gt;I've used the ABAP Proxy framework to generate a wsdl from the XSD for ZUGFeRD 2.0 XML, and from that generated an ABAP proxy to get get all the structures and types defined.&lt;/P&gt;
  &lt;P&gt;I can then use&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        DATA(with_default_ns) = cl_proxy_xml_transform=&amp;gt;abap_to_xml_xstring(
             abap_data  = input
             ddic_type  = 'ZFB_MESSAGE1'
             xml_header = 'full' ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;to get the XML. My input is the type that the ABAP Proxy has generated.&lt;/P&gt;
  &lt;P&gt;The problem is that this creates names spaces like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;n0:CrossIndustryInvoice xmlns:n0="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                         xmlns:prx="urn:sap.com:proxy:DEV:/1SAI/TASE493CC7A2F13F4EF8BCD:750"
                         xmlns:n1="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                         xmlns:n2="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                         xmlns:n3="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"&amp;gt;
	&amp;lt;n0:ExchangedDocumentContext&amp;gt;
		&amp;lt;n2:GuidelineSpecifiedDocumentContextParameter&amp;gt;
			&amp;lt;n2:ID&amp;gt;urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0&amp;lt;/n2:ID&amp;gt;
		&amp;lt;/n2:GuidelineSpecifiedDocumentContextParameter&amp;gt;
	&amp;lt;/n0:ExchangedDocumentContext&amp;gt;
	&amp;lt;n0:ExchangedDocument&amp;gt;
		&amp;lt;n2:ID&amp;gt;0090000702&amp;lt;/n2:ID&amp;gt;
		&amp;lt;n2:TypeCode&amp;gt;380&amp;lt;/n2:TypeCode&amp;gt;
		&amp;lt;n2:IssueDateTime&amp;gt;
			&amp;lt;n3:DateTimeString format="102"&amp;gt;20190829&amp;lt;/n3:DateTimeString&amp;gt;
		&amp;lt;/n2:IssueDateTime&amp;gt;
		&amp;lt;n2:IncludedNote&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But to be completely correct, I need to convert all those &lt;STRONG&gt;nm:&lt;/STRONG&gt; prefixes to ZUGFeRD prefixes - specifically&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;n0:&lt;/STRONG&gt; to &lt;STRONG&gt;rsm:&lt;/STRONG&gt;, &lt;STRONG&gt;n1&lt;/STRONG&gt;: to &lt;STRONG&gt;qdt:&lt;/STRONG&gt;, &lt;STRONG&gt;n2:&lt;/STRONG&gt; to &lt;STRONG&gt;ram:&lt;/STRONG&gt;, &lt;STRONG&gt;n3:&lt;/STRONG&gt; to &lt;STRONG&gt;udt:&lt;/STRONG&gt;&lt;BR /&gt;I've tried to use an XSLT stylesheet to transform the name prefixes. I've tried various form like this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;    &amp;lt;xsl:template match="n0:*"&amp;gt;
        &amp;lt;rsm&amp;gt;
            &amp;lt;xsl:apply-templates select="*|node()" /&amp;gt;
        &amp;lt;/rsm&amp;gt;
    &amp;lt;/xsl:template&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;and&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;  &amp;lt;xsl:template match="n0:*"&amp;gt;
    &amp;lt;xsl:element name="rsm:{local-name()}" namespace="http://sample.com/rsm"&amp;gt;
      &amp;lt;xsl:value-of select="."/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But just can't get it to work. Judging from the fact that when I set a breakpoint in it at the line after the template match it doesn't stop, it seems it just isn't finding a match.&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Anyone have any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:16:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365209#M1993370</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-01-05T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365210#M1993371</link>
      <description>&lt;P&gt;Could you please name this fake XML validator that is unable to interpret correctly namespace prefixes!!?? I'd say that it's none of your business to spend time because of their buggy validator. The namespace prefixes are not important, what is important is the URI. n0 or rsm (or whatever) pointing to the same URI are completely equivalent.&lt;/P&gt;&lt;P&gt;Concerning the XSLT question:&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;I think the way you did it is correct i.e.&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:element name="rsm:{local-name()}" namespace="http://sample.com/rsm"&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;OL&gt;&lt;LI&gt;For the match, did you declare xmlns:n0="..." at an upper level in the XSLT?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 05 Jan 2021 16:23:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365210#M1993371</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-05T16:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365211#M1993372</link>
      <description>&lt;P&gt;It's not an XML validator, it's a ZUGFeRD validator. E.g. &lt;A href="https://www.zugferd-community.net/de/open_community/validation" target="test_blank"&gt;https://www.zugferd-community.net/de/open_community/validation&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;Given that ZUGFeRD is a standard use by the German bureaucracy, I wouldn't be surprised if you have to get the namespace right... &lt;/P&gt;&lt;P&gt;Point 2: You mean the XSLT of my transformation. No... I'll give that a go! thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 16:32:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365211#M1993372</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-01-05T16:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365212#M1993373</link>
      <description>&lt;P&gt;I agree with &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; - ZUGFeRD is a certain XML format and general XML rules apply. If the validator rejects generated files, the validator may well be buggy. &lt;/P&gt;&lt;P&gt;you can get the specs here: &lt;A href="https://www.ferd-net.de/standards/zugferd-2.1.1/index.html" target="_blank"&gt;https://www.ferd-net.de/standards/zugferd-2.1.1/index.html&lt;/A&gt; - they contain XSD files that define the various levels of ZUGFeRD definition (minimal, basic, etc) - but you have the XSD, since you generated the proxy from te XSD.&lt;/P&gt;&lt;P&gt;Just use a generic XML validator that validates your generated XML against the XSD files provided by the spec. If your file is fine, raise a ticket with whoever is responsible for the validator that rejects your file. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:29:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365212#M1993373</guid>
      <dc:creator>sergei-u-niq</dc:creator>
      <dc:date>2021-01-05T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365213#M1993374</link>
      <description>&lt;P&gt;I tried various things to get the XSLT to work - but getting nowhere. You'd have thought it was quite a simple thing to do! I was using this as my base &lt;A href="https://stackoverflow.com/questions/10124887/how-to-replace-namespace-prefix-in-element-and-attributes-using-xslt" target="test_blank"&gt;https://stackoverflow.com/questions/10124887/how-to-replace-namespace-prefix-in-element-and-attributes-using-xslt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, it's all moot, since we're going with "the namespaces don't matter; your validator needs work". I think it's perhaps a shortcut they've taken, as the error message is&lt;/P&gt;&lt;P&gt;"Cannot find the declaration of element 'n0:CrossIndustryInvoice'".&lt;/P&gt;&lt;P&gt;Now using this validator (needs registration, but currently free). &lt;A href="https://portal3.gefeg.com/invoice/validation" target="test_blank"&gt;https://portal3.gefeg.com/invoice/validation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 06:21:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365213#M1993374</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-01-06T06:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365214#M1993375</link>
      <description>&lt;P&gt;I can rename the namespace prefixes (source XML with 2 namespace prefixes n0 and n2, result XML with rsm and ram) (NB: your link is very good &lt;A href="https://stackoverflow.com/questions/10124887/how-to-replace-namespace-prefix-in-element-and-attributes-using-xslt):" target="test_blank"&gt;https://stackoverflow.com/questions/10124887/how-to-replace-namespace-prefix-in-element-and-attributes-using-xslt):&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:n0="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:n2=
"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" version="1.0"&amp;gt;

  &amp;lt;xsl:strip-space elements="*"/&amp;gt;

  &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="n0:*"&amp;gt;
    &amp;lt;xsl:element name="rsm:{local-name()}" namespace="http://sample.com/rsm"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="n2:*"&amp;gt;
    &amp;lt;xsl:element name="ram:{local-name()}" namespace="http://sample.com/ram"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="text()"&amp;gt;
    &amp;lt;xsl:value-of select="."/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

&amp;lt;/xsl:transform&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jan 2021 07:55:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365214#M1993375</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-06T07:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365215#M1993376</link>
      <description>&lt;P&gt;I had to add the other namespaces, so I've now got:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:n0="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:n1="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:n2="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:n3="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                version="2.0"&amp;gt;
&amp;lt;xsl:output encoding="UTF-8" indent="yes" method="xml"/&amp;gt;&lt;BR /&gt;  &amp;lt;xsl:strip-space elements="*"/&amp;gt;
  &amp;lt;xsl:template match="/"&amp;gt;
    &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n0 to rsm --&amp;gt;
  &amp;lt;xsl:template match="n0:*"&amp;gt;
    &amp;lt;xsl:element name="rsm:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n1 to qdt --&amp;gt;
  &amp;lt;xsl:template match="n1:*"&amp;gt;
    &amp;lt;xsl:element name="qdt:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n2 to ram --&amp;gt;
  &amp;lt;xsl:template match="n2:*"&amp;gt;
    &amp;lt;xsl:element name="ram:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;!-- change the namespace declaration for n3 to udt --&amp;gt;
  &amp;lt;xsl:template match="n3:*"&amp;gt;
    &amp;lt;xsl:element name="udt:{local-name()}"&amp;gt;
      &amp;lt;xsl:apply-templates select="*|text()"/&amp;gt;
    &amp;lt;/xsl:element&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="text()"&amp;gt;
    &amp;lt;xsl:value-of select="."/&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And it's nearly working! But for...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;n2:IssueDateTime&amp;gt;
	&amp;lt;n3:DateTimeString format="102"&amp;gt;20201117&amp;lt;/n3:DateTimeString&amp;gt;
&amp;lt;/n2:IssueDateTime&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ram:IssueDateTime&amp;gt;
	&amp;lt;udt:DateTimeString&amp;gt;20201117&amp;lt;/udt:DateTimeString&amp;gt;
&amp;lt;/ram:IssueDateTime&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So for some reason, the &lt;STRONG&gt;format &lt;/STRONG&gt;attribute is being lost.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 10:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365215#M1993376</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-01-06T10:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365216#M1993377</link>
      <description>&lt;P&gt;@* must be added for attributes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
      &amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
...
  &amp;lt;xsl:template match="@*"&amp;gt;
    &amp;lt;xsl:attribute name="{local-name()}"&amp;gt;&amp;lt;xsl:value-of select="."/&amp;gt;&amp;lt;/xsl:attribute&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="@n0:*"&amp;gt;
    &amp;lt;xsl:attribute name="rsm:{local-name()}"&amp;gt;&amp;lt;xsl:value-of select="."/&amp;gt;&amp;lt;/xsl:attribute&amp;gt;
  &amp;lt;/xsl:template&amp;gt;

  &amp;lt;xsl:template match="@n2:*"&amp;gt;
    &amp;lt;xsl:attribute name="ram:{local-name()}"&amp;gt;&amp;lt;xsl:value-of select="."/&amp;gt;&amp;lt;/xsl:attribute&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jan 2021 10:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365216#M1993377</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-06T10:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Transform XML to a different namespace prefix</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365217#M1993378</link>
      <description>&lt;P&gt;Brilliant!&lt;/P&gt;&lt;P&gt;I finally constructed this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?sap.transform xslt?&amp;gt;
&amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:n0="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:n1="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:n2="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:n3="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
                xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
                xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
                xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
                version="2.0"&amp;gt;
	&amp;lt;xsl:output encoding="UTF-8"
	            indent="yes"
	            method="xml"/&amp;gt;
	&amp;lt;xsl:strip-space elements="*"/&amp;gt;
	&amp;lt;xsl:template match="/"&amp;gt;
		&amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;xsl:template match="@*"&amp;gt;
		&amp;lt;xsl:attribute name="{local-name()}"&amp;gt;
			&amp;lt;xsl:value-of select="."/&amp;gt;
		&amp;lt;/xsl:attribute&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;!-- change the namespace declaration for n0 to rsm --&amp;gt;
	&amp;lt;xsl:template match="n0:*"&amp;gt;
		&amp;lt;xsl:element name="rsm:{local-name()}"&amp;gt;
			&amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
		&amp;lt;/xsl:element&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;!-- change the namespace declaration for n1 to qdt --&amp;gt;
	&amp;lt;xsl:template match="n1:*"&amp;gt;
		&amp;lt;xsl:element name="qdt:{local-name()}"&amp;gt;
			&amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
		&amp;lt;/xsl:element&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;!-- change the namespace declaration for n2 to ram --&amp;gt;
	&amp;lt;xsl:template match="n2:*"&amp;gt;
		&amp;lt;xsl:element name="ram:{local-name()}"&amp;gt;
			&amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
		&amp;lt;/xsl:element&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;!-- change the namespace declaration for n3 to udt --&amp;gt;
	&amp;lt;xsl:template match="n3:*"&amp;gt;
		&amp;lt;xsl:element name="udt:{local-name()}"&amp;gt;
			&amp;lt;xsl:apply-templates select="*|text()|@*"/&amp;gt;
		&amp;lt;/xsl:element&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
	&amp;lt;xsl:template match="text()"&amp;gt;
		&amp;lt;xsl:value-of select="."/&amp;gt;
	&amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've checked in both ZUGFeRD community and gefeg/invoice.fans and it works. It's all valid. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 11:09:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transform-xml-to-a-different-namespace-prefix/m-p/12365217#M1993378</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-01-06T11:09:33Z</dc:date>
    </item>
  </channel>
</rss>

