Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Broken Processing Instruction

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi All,

I have a processing instruction in my xml:
<?Pub _hardspace?>
and I am replacing it with an entity using XSL:
<xsl:template match="//processing-instruction('Pub')[.='_hardspace']">&#160;</xsl:template>

My problem is that if the XML has the PI stored at the end of the line like this:
<?Pub _hardspace
?>
then the XSL doesn't work.

Can someone suggest a solution ?

TIA,
Sheila
 
>[tt]<xsl:template match="//processing-instruction('Pub')[.='_hardspace']">&#160;</xsl:template>[/tt]

You could correct the problem by doing this.

[tt]<xsl:template match="//processing-instruction('Pub')[[blue]normalize-space(.)[/blue]='_hardspace']">&#160;</xsl:template>
[/tt]

 
Thanks, tsuji. I'll try your solution.

In the meanwhile I also tried using startswith() function, and it worked!

Sheila
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top