RE: [xsl] MSXML Script Enable, syntax for child of chil of parent of parent that has same name and has some attribute

Subject: RE: [xsl] MSXML Script Enable, syntax for child of chil of parent of parent that has same name and has some attribute
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Mon, 27 Aug 2001 23:35:46 +0100
Nathan,
1. That is strange it works fine here. Did you try the code I posted. I
thought you might be using the old msxml.
It is unlikely that there is anything that you can't do with xsl and
nodes that requires you to use msxml:script. If you just want previous
elements then look at the axes previous:: previous-sibling:: ancestor::
If you tell us exactly what you want to do then I'm sure someone will
come up with a solution.

2. <xsl:when test="../../*/*[@isSquare='Y']">

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Nathan Zhou
> Sent: 27 August 2001 22:52
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] MSXML Script Enable, syntax for child of 
> chil of parent of parent that has same name and has some attribute
> 
> 
> Hi Chris:
> Thanks for your reply.  
> 1) Yes, I am running in MSXSML 3.0 in replacement
> mode.  The reason is that I am using xsl:import and
> xsl:include and if I don't use replacement mode, the
> page somehow will not show up.   Is that the reason
> that the browser is complaining about 
> "function not in user namespace"?  Or in replacement
> mode I cannot have scripts?  
>    I am using the script to help me perform additional 
> transformation that the XSL transform template cannot handle. 
>  For example, it will be nice if I can keep an array which 
> saves the earlier processd elements, and output them later 
> when I encounter some other xml elements.  
>    MSXSML 4.0 has come out already and in it
> replacement is got rid off.  When I installed it, the
> the xsl:scripts that has import/include does not show
> up.  What is the general approach here?
> 
> 2) <xsl:when test="../../meta/a[@isSquare='Y']">...
>     What if I do not know the name meta and a?  I just
> know it is a child and child of "../.." that has the
> same name as the context/current node and has
> [@isSquare='Y']?
> 
> Thanks for you help again.  
>   
> 
> 
> 
> 
> 
> 
> <xsl:when test="../../meta/a[@isSquare='Y']">...
> > 
> --- Chris Bayes <chris@xxxxxxxxxxx> wrote:
> > Nathan,
> > Works fine here.
> > 
> > <?xml version="1.0" ?>
> > <?xml-stylesheet type="text/xsl"
> > href="stylesheet01.xsl" ?>
> > <test>
> >  <te>this is a test</te>
> > </test>
> > 
> > With your stylesheet
> > 
> > <?xml version='1.0'?>
> > <xsl:stylesheet version="1.0"
> >      
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> >       xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> >       xmlns:user="http://mycompany.com/mynamespace";>
> > 
> > <msxsl:script language="JScript"
> > implements-prefix="user">
> >    function xml(nodelist) {
> >       return nodelist.nextNode().xml;
> >    }
> > </msxsl:script>
> > 
> > <xsl:template match="/">
> >    <xsl:value-of select="user:xml(.)"/>
> > </xsl:template>
> > 
> > </xsl:stylesheet>
> > 
> > Gives
> > 
> > <?xml version="1.0" encoding="UTF-16"?>&lt;?xml version="1.0"?&gt;
> > &lt;?xml-stylesheet type="text/xsl"
> > href="stylesheet01.xsl" ?&gt;
> > &lt;test&gt;
> >  &lt;te&gt;this is a test&lt;/te&gt;
> > &lt;/test&gt;
> > 
> > As expected thought why you would want to do that...
> > Are you in replace mode?
> > 
> > <xsl:when test="../../meta/a[@isSquare='Y']">...
> > 
> > Ciao Chris
> > 
> > XML/XSL Portal
> > http://www.bayes.co.uk/xml
> > 
> > 
> > > -----Original Message-----
> > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On
> > Behalf Of
> > > Nathan Zhou
> > > Sent: 27 August 2001 17:40
> > > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject: [xsl] MSXML Script Enable, syntax for
> > child of chil
> > > of parent of parent that has same name and has
> > some attribute
> > > 
> > > 
> > > Hi:
> > > 1)  I am trying to translate the xml data to html
> > in a
> > > table format.  The xml data format is something
> > like
> > > <cell rpos="1" cpos="1"></cell>
> > > <cell rpos="1" cpos="2"></cell>
> > > <cell rpos="2" cpos="1"></cell>
> > > <cell rpos="2" cpos="2"></cell>
> > > 
> > > and would like the final html format to render the
> > > html to appear correctly.
> > > 
> > > I am trying to use the MXSML:SCRIPT tag and use my
> > own
> > > user space, as in the example posted by microsoft.
> > > 
> > > <?xml version='1.0'?>
> > > <xsl:stylesheet version="1.0"
> > >      
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> > >       xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> > >      
> > xmlns:user="http://mycompany.com/mynamespace";>
> > > 
> > > <msxsl:script language="JScript"
> > > implements-prefix="user">
> > >    function xml(nodelist) {
> > >       return nodelist.nextNode().xml;
> > >    }
> > > </msxsl:script>
> > > 
> > > <xsl:template match="/">
> > >    <xsl:value-of select="user:xml(.)"/>
> > > </xsl:template>
> > > 
> > > </xsl:stylesheet>
> > > 
> > > but the browser is complaining that user namespace
> > > doesnot have the function.  Can anyone help?
> > > 2) What is the syntax to refer to the child of
> > child
> > > of parent of parent of the current node that has
> > the
> > > same name as the current node but has a certain
> > > attribute?
> > > 
> > > for example:
> > > <sec>
> > > <meta>
> > > <a isSquare='Y'>
> > > <b>
> > > <c>
> > > </meta>
> > > 
> > > <data>
> > > <a>
> > > <b>
> > > <c>
> > > </data>
> > > <sec>
> > > Let's the current node is <a> in <data>, how do I
> > > write my (xsl:when> expression based on <a> in
> > > <meta>'s attribute equal to something?
> > > 
> > > thanks in advance.
> > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute
> > with
> > > Yahoo! Messenger http://phonecard.yahoo.com/
> > > 
> > >  XSL-List info and archive:
> > http://www.mulberrytech.com/xsl/xsl-list
> > > 
> > > 
> > 
> > 
> >  XSL-List info and archive:
> > http://www.mulberrytech.com/xsl/xsl-list
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with 
> Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread