Re: [xsl] creating multiple xml documents from one large xml document

Subject: Re: [xsl] creating multiple xml documents from one large xml document
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 May 2023 13:10:27 -0000
On 5/29/2023 2:39 PM, LEGAULT, PHILLIP plegault@xxxxxxxxxx wrote:
>
> I tried adding the namespace and still nothing
>

With XSLT 2 or 3, to have your pattern match e.g. records
xsi:type="sf:Case" within a certain namespace you would declare

 B  xpath-default-namespace="urn:enterprise.soap.sforce.com"

on the xsl:stylesheet or xsl:transform root element or for local
application only on the xsl:template.


Then e.g. <xsl:template match="records[@xsi:type = 'sf:Case']"> should
match that records element.

> *From:* Michael Kay mike@xxxxxxxxxxxx
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
> *Sent:* Monday, May 29, 2023 8:14 AM
> *To:* xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> *Subject:* [EXTERNAL] Re: [xsl] creating multiple xml documents from
> one large xml document
>
> Standard namespace problem (often seen with SOAP): your elements are
> in a namespace
>
>     B xmlns="urn:enterprise.soap.sforce.com
>     <http://enterprise.soap.sforce.com/>"
>
> which you ignored when trying to match them.
>
>     <xsl:stylesheet version="2.0"
>
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>
>     B B B  xmlns:sf="urn:sobject.enterprise.soap.sforce.com
>     <http://sobject.enterprise.soap.sforce.com/>"
>
>     B B B  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>
>     <xsl:template match="records[@xsi:type = 'sf:CaseNote_GCC__c']">
>
>     B B  <xsl:result-document href="case-{sf:Id}-{sf:CaseNumber}.xml">
>
>     B B B B  <xsl:copy-of select="."/>
>
>     </xsl:result-document>
>
>     </xsl:template>
>
>     </xsl:stylesheet>
>
>     Not getting any result files.

Current Thread