Hit a brick wall

Hit a brick wall

Post by PJ » Thu, 19 Jun 2003 22:38:15



If I have a Xpath in a variable

<xsl:variable name="mypath">/data/mynane</xsl:variable>

How do I than use this to select the data

<xsl:value-of select="??($mypath)"/>

I've written a java function for the ?? above but the call out to java
is slow so large pages a 10* slower than a simple transform.

 
 
 

Hit a brick wall

Post by Oleg Tkachenk » Fri, 20 Jun 2003 00:02:06



> If I have a Xpath in a variable

> <xsl:variable name="mypath">/data/mynane</xsl:variable>

> How do I than use this to select the data

> <xsl:value-of select="??($mypath)"/>

No way without extension function.
Why do you need it?
What's wrong with usual

<xsl:variable name="mydata" select="/data/mynane"/>
...
<xsl:value-of select="$mydata"/>

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

 
 
 

Hit a brick wall

Post by philip Harriso » Thu, 19 Jun 2003 23:52:19


I've posted a "Spooky Magic" message with a full example.

In summary the XPATH that we want is defined in an XML document (along
with the page content - i.e. the words aroung the data):

 <bdata src="/mydata/myname"/>

and the template "bdata" does


 <xsl:value-of select="get_node($src)"/>
 (I know this could be one step)

and my java

<msxsl:script language="JScript" implements-prefix="cache">
<![CDATA[
function get_node(srcValue)
{      
return srcValue.item(0).selectNodes(srcValue.item(0).text);

Quote:}

]]>
</msxsl:script>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
 
 

Hit a brick wall

Post by Oleg Tkachenk » Fri, 20 Jun 2003 01:00:02



> In summary the XPATH that we want is defined in an XML document (along
> with the page content - i.e. the words aroung the data):

That's quite unusual case, when data also contains XPath expressions. And
usual approach for this unusual case is two-step transformation, when first
you are generating xslt stylesheet on the fly and then run it.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
 
 
 

1. XML Brick Wall

I have been trying to figure out XML the past couple of days and have come
up with a table of contents XML file with stores a list of topics and sub
topics. I have then used an XSL file to convert this data into a web page
which lay's out the content as a TOC such as that used on the MSDN web site
(www.msdn.microsoft.com/library).

What now????

How do you apply different XSL styles to the same data, without having to
manually change the <?xml:stylesheet href="toc.xsl"?> link of the XML
document? i.e. allow users of my web page to apply different styles so I
can provide filter, layout and sort options

Can someone please enlighten me.

--
Posted via CNET Help.com
http://www.help.com/

2. how I can publish a software ??

3. XML Brick Wall...

4. infiniband study group

5. OS2 2.1 Installation brick wall.

6. WTB: Two(2) Amiga Ethernet cards

7. TAPI, DUN and a brick wall

8. Windows XP styled controls?

9. need another brick in the grey wall (northern Europe)

10. Another Brick In The Wall

11. Do we _have_ to have a brick wall?

12. planets align/myprog BRICK-WALL some text boxes.

13. need another brick in the grey wall (northern Europe)