Subject: Re: [xsl] Problem processing unescaped nested span TEXT with parse-xml-fragment From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 4 Apr 2019 11:07:37 -0000 |
The stylesheet code looks like this:
<xsl:variable name="FRAGMENTTEXT" select="./Content/Fragment[contains(text( ), '<span ')]"/>
<xsl:if test="$FRAGMENTTEXT!=''">
<xsl:variable select="parse-xml-fragment($FRAGMENTTEXT)" name="UNESCAPEDTEXT" />
<xsl:call-template name="annotations"> <xsl:with-param select="$UNESCAPEDTEXT" name="UNESCAPEDTEXT"/> <xsl:with-param select="." name="EVENT"/> </xsl:call-template> </xsl:if>
Unescaped FRAGMENT TEXT example:
<Fragment><span><span class="meta" cid="2">sassafras plant</span> is a slightly black oil called <span class="meta" cid="3">safrole</span>. Synthetic manufacturing methods are used to convert the safrole to <span class="meta" cid="4">MDMA</span>. Relative small amounts are required to create large amounts of <span class="meta" cid="5">ecstacy</span> pills.</span></Fragment>
Unescaped the Fragment looks like this:
<span> <span class="meta" cid="2">sassafras plant</span> is a slightly black oil called <span class="meta" cid="3">safrole</span>. Synthetic manufacturing methods are used to convert the safrole to <span class="meta" cid="4">MDMA</span> . Relative small amounts are required to create large amounts of <span class="meta" cid="5">ecstacy</span> pills. </span>
The error:
*Severity:* fatal *Description:* A sequence of more than one item is not allowed as the first argument of fn:parse-xml-fragment() ("In the rain forests of <span c...", "<span><span class="meta" cid="...")
Can ./Content/Fragment[contains(text(), '<span ')] select more than one Fragment element?
Then you would need e.g. $FRAGMENTTEXT!parse-xml-fragment(.) to process them all in one go.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Problem processing unescaped , rus tle profrustylea | Thread | Re: [xsl] Problem processing unesca, rus tle profrustylea |
[xsl] Problem processing unescaped , rus tle profrustylea | Date | [xsl] "Hey XSLT processor, execute , Costello, Roger L. c |
Month |