Pregunta

I have the below code in my xml file.

<p>
  <line><?xm-replace_text {p}?></line>
</p>

What is xm-replace_text? How to parse this thing? Can anybody help me? I have searched alot. But I want to know what to write in my xslt if this is encountered in the xml file. I am generating xsl fo output.

Thank you.

¿Fue útil?

Solución

First things first. As Kirill said, that's a processing instruction (PI), a marker to indicate that an application should do something. From the point of view of XSLT it's a node type. Particularly, it's an XMetal processing instruction used in the editor to do a text insertion marker of some kind (it's a long time since I used XMetal so I don't remember exactly how it behaves).

If you are seeing this when you convert to FO, then you already have a small problem because it should already have been replaced with some meaningful text in the editor.

You can match it with XSLT easily but it's hard to see what you should actually do with it. Matching it would require a template like:

<xsl:template match="processing-instruction('xm-replace_text')">
    <!-- do something useful here -->
</xsl:template>

You can get at the value of the PI simply by accessing the value of it. The value of your PI is {p}.

Not too helpful, I'm afraid - it's an application feature.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top