p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

xslt thread: unescape in xslt?

Message #1 by gkallidis@g... on Fri, 7 Jun 2002 10:31:32
Thank you very much for clarifying this point! I now inserting the xml-
tags dynamically in the xslt document, which are then available via 
document(''). Unfortunately I cannot find another way to hand over ) a DOM 
Document to the xsl-processor (while using the perl interface to LibXSLT).

> It's not "unescaping" you want to do, it's XML parsing. You can't invoke
an XML parser directly from within XSLT, but you can do it via extension
functions. Since you seem to have JavaScript around, try writing a
JavaScript extension function that does the parsing (converts a string
to a DOM Document) and returns the result.

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s... 

> -----Original Message-----
> From: gkallidis@g... [mailto:gkallidis@g...] 
> Sent: 07 June 2002 10:32
> To: P2P_XSLT
> Subject: [xslt] unescape in xslt?
> I have to read a string, which is escaped then escaped in 
> xsl. But it has to become a tree structure.  Is there a way 
> to unescape in 
> xsl ? There are quite a lot of parameters in there and quite a lot of 
> elements inside. If this doesnt work, I have to write it in a 
> temporary 
> file, then call it with the document() function, seems to be the only 
> solution. 
> e.g. 
> $dois = "
> <REFID KEY="1">
>  <A HREF="javascript:ref('10.1007/s003830050669')">DOI</A>
> </REFID>
> <REFID KEY="12">
>  <A HREF="/cgi/?AK=12068&CTXquery=-1&JK=23&IK=920">DOI</A>
> </REFID>
> "
> Pseudo-syntax:
> application-call-xsl-stylesheet( dois=>$dois )
> in xsl-stylesheet: <xsl:param name="dois"/>
> $dois then gets the string in this form:
> lt;REFID KEY=&quot;1&quot;&gt;&lt;A HREF=&quot;javascript:ref 
> ('10.1007/s003830050669')&quot;&gt;DOI&lt;/A&gt;&lt;/REFID&gt;
> &lt;REFID 
> KEY=&quot;12&quot;&gt;&lt;A HREF=&quot;/cgi/?AK=12068&amp;CTXquery=-
> 1&amp;JK=23&amp;IK=920&quot;&gt;DOI&lt;/A&gt;&lt;/REFID&gt;'
> but how from there on to get the original ??
> Thank you for helping !
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or 
> to unsubscribe send a blank email to 

  Return to Index