0

I have more than one processing-instructions in xml, but have to get specific PI(i.e xpp:PageOption) and stored in Global variable.how can i achieve this. Please help me

Please find the below sample input mark-up.

                        <?xpp xpp:ps1?>
                        <tag name="html"/>
                        <?xpp xpp:Formater username=&quot;name&quot; ?>
                        <t x="0" y="0" style="html" cgt="true" suppress="true">FirstName LastName</t>
                        <?xpp xpp:PageOptions  showpage=&quot;yes&quot; height=&quot;10&quot; fonttype=&quot;times&quot; linespace=&quot;single&quot; >
                        <tag name="meta">
                            <attr name="http-equiv">Content-Type</attr>
                            <attr name="content">text/html; charset=UTF-8</attr>
                        </tag>

Thanks

it'sme
  • 531
  • 6
  • 23

1 Answers1

1

Well with <xsl:variable name="pi1" select="//processing-instruction('xpp')[contains(., 'xpp:PageOptions')]"/> you can select the processing-instruction with name xpp which contains the string xpp:PageOptions in its data. You need to be aware that the data of a processing-instruction is unstructured, it often looks like a list pseudo attributes but there are no rules on the structure of the data and thus if you expect a certain structure you need to process the data as a string.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110