RE: [xsl] Namespaces in XMLSpy

Subject: RE: [xsl] Namespaces in XMLSpy
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Mar 2005 21:21:20 -0000
The general rule with [xsl:]xxxx attributes is: use the xsl: prefix on the
attribute if it's not present on the element. So if the attribute is on the
xsl:stylesheet element, it should omit the prefix.

If it still doesn't work, it may because XML Spy hasn't yet implemented this
feature - I don't know. I would have expected that if the feature isn't
implemented, they would tell you.

Michael Kay
http://www.saxonica.com

 

> -----Original Message-----
> From: Jonathan Marenus [mailto:jonathanmarenus@xxxxxxxxx] 
> Sent: 04 March 2005 20:24
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Namespaces in XMLSpy
> 
> 
> I am using XSLT version 2.0 and my stylesheet tag now
> looks like this: 
> 
> <xsl:stylesheet version="2.0"  
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> xsl:xpath-default-namespace="yyyy">
> 
> I haven't changed any other part of my code and I
> tried the xpath-default-namespace with and without the
> 'xsl:'.  I am still getting the same error I had
> before.  Any further ideas?
> 
> Jonathan Marenus
> 
> 
> --- Michael Kay <mike@xxxxxxxxxxxx> wrote:
> 
> > Sorry the reply was so brief, it was late at night,
> > and I thought the
> > information might be enough.
> > 
> > Let's write expanded names in the form
> > {namespace}local.
> > 
> > In the document
> > 
> > <A xmlns="yyyy">
> >   <B>
> >     <C/>
> >   </B>
> > </A>
> > 
> > you have three elements whose expanded names are
> > {yyyy}A, {yyyy}B, and
> > {yyyy}C.
> > 
> > In XSLT 1.0, to match an element {yyyy}A, you need
> > to bind a namespace
> > prefix to yyyy and use that prefix in the match
> > pattern or XPath expression
> > step. For example
> > 
> > <xsl:template match="y:A" xmlns:y="yyyy">
> >   <xsl:value-of select="y:B/y:C"/>
> > </xsl:template>
> > 
> > In XSLT 2.0, you can set
> > xpath-default-namespace="yyyy" instead.
> > 
> > Michael Kay
> > http://www.saxonica.com/ 
> > 
> > > -----Original Message-----
> > > From: Jonathan Marenus
> > [mailto:jonathanmarenus@xxxxxxxxx] 
> > > Sent: 04 March 2005 06:02
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject: RE: [xsl] Namespaces in XMLSpy
> > > 
> > > 
> > > Ok, Let's say my XML file consists of 3 elements
> > A,B,C
> > > with A being the outermost element with a
> > namespace
> > > declaration of xmlns="yyyyy".  In what way are the
> > > element names B and C changed and in what way must
> > I
> > > change the stylesheet to match those new names. 
> > This
> > > has been a problem at work that I have been
> > putting
> > > off for the last 3 months and it has gotten to the
> > > point where I must have it working.  I just
> > started
> > > using XSL 5 months ago so being explicit would
> > help
> > > very much so.
> > > 
> > > Thanks.
> > > 
> > > Jonathan Marenus
> > > 
> > > --- Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > > 
> > > > If you have a namespace declaration such as
> > > > xmlns="yyyyy" in your outermost
> > > > element, this changes the name of every element
> > in
> > > > your document, and your
> > > > stylesheet must be changed to match the new
> > names.
> > > > 
> > > > Michael Kay
> > > > http://www.saxonica.com/ 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Jonathan Marenus
> > > > [mailto:jonathanmarenus@xxxxxxxxx] 
> > > > > Sent: 03 March 2005 22:10
> > > > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > > > Subject: [xsl] Namespaces in XMLSpy
> > > > > 
> > > > > 
> > > > > Ok, here's my problem:
> > > > > 
> > > > >       I have both a namespace and a schema as
> > > > > attributes in my root element.  I am using
> > XMLSpy
> > > > to
> > > > > transform the file, and for some unknown
> > reason,
> > > > it is
> > > > > copying the entire original file into output
> > > > instead
> > > > > of making the changes that I specify in the
> > XSL
> > > > file. 
> > > > > If I delete those attributes, the XSL
> > > > transformation
> > > > > is successful, but I need to find a way for it
> > to
> > > > work
> > > > > with the namespace and schema attributes in
> > there.
> > > >  I
> > > > > am not sure if this problem is specifically
> > > > related to
> > > > > XMLSpy.  It could be that I need to add
> > something
> > > > in
> > > > > my XSL code or even a change in settings in
> > > > XMLSpy,
> > > > > but either way, I need this resolved as soon
> > as
> > > > > possible so any feedback would be greatly
> > > > appreciated.
> > > > >  Thanks.
> > > > > 
> > > > > Jonathan Marenus
> > > > > 
> > > > > 
> > > > > 	
> > > > > 		
> > > > > __________________________________ 
> > > > > Celebrate Yahoo!'s 10th Birthday! 
> > > > > Yahoo! Netrospective: 100 Moments of the Web 
> > > > > http://birthday.yahoo.com/netrospective/
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 	
> > > 		
> > > __________________________________ 
> > > Celebrate Yahoo!'s 10th Birthday! 
> > > Yahoo! Netrospective: 100 Moments of the Web 
> > > http://birthday.yahoo.com/netrospective/
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Celebrate Yahoo!'s 10th Birthday! 
> Yahoo! Netrospective: 100 Moments of the Web 
> http://birthday.yahoo.com/netrospective/

Current Thread