XSLT and XSD

Discussion in 'XML' started by Mark Constant, Oct 28, 2003.

  1. I posted this on topxml.com and nobody has responded so I was hoping
    somebody could help me here. I am following some tutorials in VS.NET.
    I created a XSD schema file and then from there created an XML file.
    Everything works okay and my data is validated against the schema. Now
    when I try to display my xml using xsl it won't work unless I get rid
    of the xmlns property of the xml file that points to my schema. Why
    would I need to get rid of that property for the xml to display?
     
    Mark Constant, Oct 28, 2003
    #1
    1. Advertising

  2. This is a very FAQ. Read for example:

    None of my XPath select statements will work going against an XML file with
    a default namespace. Help!
    by Mark Bosley



    at: http://www.topxml.com/people/bosley/defaultns.asp



    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    "Mark Constant" <> wrote in message
    news:...
    > I posted this on topxml.com and nobody has responded so I was hoping
    > somebody could help me here. I am following some tutorials in VS.NET.
    > I created a XSD schema file and then from there created an XML file.
    > Everything works okay and my data is validated against the schema. Now
    > when I try to display my xml using xsl it won't work unless I get rid
    > of the xmlns property of the xml file that points to my schema. Why
    > would I need to get rid of that property for the xml to display?
     
    Dimitre Novatchev, Oct 29, 2003
    #2
    1. Advertising

  3. Mark Constant

    FC Guest

    I have a slightly different problem instead and I can't find the way out.
    I am not using an explicit default namespace, but I am hitting the famous
    problem of the unwanted namespace declarations inside result tree elements:

    Take the samples at TopXml and change them slightly:


    <?xml version="1.0" encoding="UTF-8"?>

    <requestHierarchySelectResult resultName=""
    xmlns:cs="http://www.customsolids.com">

    <request>

    <created_dt>05/05/2000 00:00:00</created_dt>

    <created_tm>01/01/1900 14:02:46</created_tm>

    <cs:request_id>

    <my_value>12345</my_value>

    </cs:request_id>

    </request>

    </requestHierarchySelectResult>



    <?xml version="1.0" encoding="UTF-8"?>

    <xsl:stylesheet

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    xmlns:cs="http://www.customsolids.com"

    version="1.0"

    exclude-result-prefixes="cs">

    <xsl:eek:utput indent="yes"/>

    <xsl:template match="/">

    <out>

    <xsl:apply-templates select="//cs:request_id/my_value"/>

    </out>

    </xsl:template>

    <xsl:template match="*|@*|node()"/>

    <xsl:template match="my_value">

    <xsl:copy>

    <xsl:value-of select="."/>

    </xsl:copy>

    </xsl:template>

    </xsl:stylesheet>



    The result is:

    <?xml version="1.0" encoding="UTF-8"?>

    <out>

    <my_value xmlns:cs="http://www.customsolids.com">12345</my_value>

    </out>



    My question is, how to get rid of the xmlns:cs namespace declararion inside
    <my_value>?

    Bye,

    Flavio
     
    FC, Oct 29, 2003
    #3
  4. "FC" <> wrote in message
    news:exOnb.372683$...
    > I have a slightly different problem instead and I can't find the way out.
    > I am not using an explicit default namespace, but I am hitting the famous
    > problem of the unwanted namespace declarations inside result tree

    elements:
    >
    > Take the samples at TopXml and change them slightly:
    >
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    >
    > <requestHierarchySelectResult resultName=""
    > xmlns:cs="http://www.customsolids.com">
    >
    > <request>
    >
    > <created_dt>05/05/2000 00:00:00</created_dt>
    >
    > <created_tm>01/01/1900 14:02:46</created_tm>
    >
    > <cs:request_id>
    >
    > <my_value>12345</my_value>
    >
    > </cs:request_id>
    >
    > </request>
    >
    > </requestHierarchySelectResult>
    >
    >
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    >
    > <xsl:stylesheet
    >
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    > xmlns:cs="http://www.customsolids.com"
    >
    > version="1.0"
    >
    > exclude-result-prefixes="cs">
    >
    > <xsl:eek:utput indent="yes"/>
    >
    > <xsl:template match="/">
    >
    > <out>
    >
    > <xsl:apply-templates select="//cs:request_id/my_value"/>
    >
    > </out>
    >
    > </xsl:template>
    >
    > <xsl:template match="*|@*|node()"/>
    >
    > <xsl:template match="my_value">
    >
    > <xsl:copy>
    >
    > <xsl:value-of select="."/>
    >
    > </xsl:copy>
    >
    > </xsl:template>
    >
    > </xsl:stylesheet>
    >
    >
    >
    > The result is:
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    >
    > <out>
    >
    > <my_value xmlns:cs="http://www.customsolids.com">12345</my_value>
    >
    > </out>
    >
    >
    >
    > My question is, how to get rid of the xmlns:cs namespace declararion

    inside
    > <my_value>?



    The short answer is: You get what you specified -- copying an element copies
    all its namespace nodes. This element is not a literal-result-element, so
    exclude-result-prefixes does not apply to it.

    Also, the meaning of copying is to copy the node as is with no change. This
    means that all namespace nodes of the node must be copied.

    To achieve what you want use:

    <xsl:template match="my_value">
    <xsl:element name="{name()}">
    <xsl:value-of select="."/>
    </xsl:element>
    </xsl:template>



    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
     
    Dimitre Novatchev, Oct 29, 2003
    #4
  5. Mark Constant

    FC Guest

    "Dimitre Novatchev" <> wrote in message
    news:bnontr$14352i$-berlin.de...
    >
    > "FC" <> wrote in message
    > news:exOnb.372683$...
    >
    > > My question is, how to get rid of the xmlns:cs namespace declararion

    > inside
    > > <my_value>?

    >
    >
    > The short answer is: You get what you specified -- copying an element

    copies
    > all its namespace nodes. This element is not a literal-result-element, so
    > exclude-result-prefixes does not apply to it.
    >
    > Also, the meaning of copying is to copy the node as is with no change.

    This
    > means that all namespace nodes of the node must be copied.
    >
    > To achieve what you want use:
    >
    > <xsl:template match="my_value">
    > <xsl:element name="{name()}">
    > <xsl:value-of select="."/>
    > </xsl:element>
    > </xsl:template>
    >
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL
    >


    Thanks Dimitre!
    What makes me feel so sad is that I've been using Xpath inline expressions
    all over my transformations and my brain went blank in this case.
    I mean, it's so obvious I can solve it by replacing each and every element
    with its cleansed counterpart by means of name().
    And I can't even take a vacation, it's still 9 months ahead...

    Bye,
    Flavio
     
    FC, Oct 29, 2003
    #5
  6. "Dimitre Novatchev" <> wrote in message news:<bnnqsc$13q5c1$-berlin.de>...
    > This is a very FAQ. Read for example:
    >
    > None of my XPath select statements will work going against an XML file with
    > a default namespace. Help!
    > by Mark Bosley
    >
    >
    >
    > at: http://www.topxml.com/people/bosley/defaultns.asp
    >
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL


    Thank you for your help. I got it so the elements display on a screen
    but now the HTML doesn't work. Here is what I have so far. Sorry if
    this looks ugly but I am new to this.


    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:lc="http://mark/DevelopmentWebsite">
    <xsl:template match="lc">
    <h2>My Game Collection</h2>
    <table border="1">
    <xsl:for-each select="lc:Entertainment/GameList">
    <tr>
    <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    </tr>
    <tr>
    <td>
    <xsl:element name="lc:IMG">
    <xsl:attribute name="lc:SRC">
    <xsl:value-of select="lc:Image"/>
    </xsl:attribute>
    </xsl:element>
    </td>
    <td><xsl:value-of select="lc:Description"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>
     
    Mark Constant, Oct 30, 2003
    #6
  7. >
    > Thank you for your help. I got it so the elements display on a screen
    > but now the HTML doesn't work. Here is what I have so far. Sorry if
    > this looks ugly but I am new to this.
    >
    >
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:lc="http://mark/DevelopmentWebsite">
    > <xsl:template match="lc">
    > <h2>My Game Collection</h2>
    > <table border="1">
    > <xsl:for-each select="lc:Entertainment/GameList">
    > <tr>
    > <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    > </tr>
    > <tr>
    > <td>
    > <xsl:element name="lc:IMG">
    > <xsl:attribute name="lc:SRC">
    > <xsl:value-of select="lc:Image"/>
    > </xsl:attribute>
    > </xsl:element>
    > </td>
    > <td><xsl:value-of select="lc:Description"/></td>
    > </tr>
    > </xsl:for-each>
    > </table>
    > </xsl:template>
    > </xsl:stylesheet>



    Unless somebody is a clairevoyant (and also knows xslt) you're probably not
    going to get any help.

    Where is your source xml document?

    What is the result that you want to get?

    What output do you get instead?

    What are the essential properties of the transformation?

    What does it mean "the HTML doesn't work" ?


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
     
    Dimitre Novatchev, Oct 30, 2003
    #7
  8. "Dimitre Novatchev" <> wrote in message news:<bnqjc7$141pu9$-berlin.de>...
    > Unless somebody is a clairevoyant (and also knows xslt) you're probably not
    > going to get any help.
    >
    > Where is your source xml document?
    >
    > What is the result that you want to get?
    >
    > What output do you get instead?
    >
    > What are the essential properties of the transformation?
    >
    > What does it mean "the HTML doesn't work" ?
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL


    Sorry I didn't include everything. Anyways all I am getting is a
    string that reads 1ps2slycooperAWittygamethatisfunforeberybodyimages\SlyCooper.jpg
    on a html page. When I say "the HTML doesn't work" I mean that the
    tables and headings aren't appearing on the page so that the page
    doesn't comes out formatted. All I want is a clean list of a picture,
    title, and description on a HTML page. I am trying to get a very basic
    ..xml file working and from there I will build upon it. Below are my
    files.

    Here is my games.xsd file
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <xs:schema id="Games" targetNamespace="http://mark/DevelopmentWebsite"
    elementFormDefault="qualified" xmlns="http://mark/DevelopmentWebsite"
    xmlns:mstns="http://mark/DevelopmentWebsite"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="Entertainment">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="GameList">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="ID" type="xs:positiveInteger" />
    <xs:element name="Console" type="xs:string" />
    <xs:element name="Title" type="xs:string" />
    <xs:element name="Description" type="xs:string" />
    <xs:element name="Image" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    This is my games.xml file
    <?xml version="1.0" encoding="utf-8" ?>
    <Entertainment xmlns="http://mark/DevelopmentWebsite">
    <GameList>
    <ID>1</ID>
    <Console>PS2</Console>
    <Title>Sly Cooper</Title>
    <Description>A fun game for everybody</Description>
    <Image>images\SlyCooper.jpg</Image>
    </GameList>
    </Entertainment>

    This is my games.xslt file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:lc="http://mark/DevelopmentWebsite">
    <xsl:template match="lc">
    <h2>My Game Collection</h2>
    <table border="1">
    <xsl:for-each select="lc:Entertainment/GameList">
    <tr>
    <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    </tr>
    <tr>
    <td>
    <xsl:element name="lc:IMG">
    <xsl:attribute name="lc:SRC">
    <xsl:value-of select="lc:Image"/>
    </xsl:attribute>
    </xsl:element>
    </td>
    <td><xsl:value-of select="lc:Description"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>
     
    Mark Constant, Oct 30, 2003
    #8
  9. > This is my games.xml file
    > <?xml version="1.0" encoding="utf-8" ?>
    > <Entertainment xmlns="http://mark/DevelopmentWebsite">
    > <GameList>
    > <ID>1</ID>
    > <Console>PS2</Console>
    > <Title>Sly Cooper</Title>
    > <Description>A fun game for everybody</Description>
    > <Image>images\SlyCooper.jpg</Image>
    > </GameList>
    > </Entertainment>
    >
    > This is my games.xslt file
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:lc="http://mark/DevelopmentWebsite">
    > <xsl:template match="lc">


    There is no element named "lc" in your source.xml -- this template is never
    instantiated.

    This completely explains what you get (this is the result of the XSLT
    built-in templates) -- just the concatenation of all text nodes.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    > <h2>My Game Collection</h2>
    > <table border="1">
    > <xsl:for-each select="lc:Entertainment/GameList">
    > <tr>
    > <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    > </tr>
    > <tr>
    > <td>
    > <xsl:element name="lc:IMG">
    > <xsl:attribute name="lc:SRC">
    > <xsl:value-of select="lc:Image"/>
    > </xsl:attribute>
    > </xsl:element>
    > </td>
    > <td><xsl:value-of select="lc:Description"/></td>
    > </tr>
    > </xsl:for-each>
    > </table>
    > </xsl:template>
    > </xsl:stylesheet>
     
    Dimitre Novatchev, Oct 30, 2003
    #9
  10. "Dimitre Novatchev" <> wrote in message news:<bnrop8$10ja24$-berlin.de>...
    > > This is my games.xml file
    > > <?xml version="1.0" encoding="utf-8" ?>
    > > <Entertainment xmlns="http://mark/DevelopmentWebsite">
    > > <GameList>
    > > <ID>1</ID>
    > > <Console>PS2</Console>
    > > <Title>Sly Cooper</Title>
    > > <Description>A fun game for everybody</Description>
    > > <Image>images\SlyCooper.jpg</Image>
    > > </GameList>
    > > </Entertainment>
    > >
    > > This is my games.xslt file
    > > <?xml version="1.0" encoding="ISO-8859-1"?>
    > > <xsl:stylesheet version="1.0"
    > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > > xmlns:lc="http://mark/DevelopmentWebsite">
    > > <xsl:template match="lc">

    >
    > There is no element named "lc" in your source.xml -- this template is never
    > instantiated.
    >
    > This completely explains what you get (this is the result of the XSLT
    > built-in templates) -- just the concatenation of all text nodes.
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL
    >
    >
    > > <h2>My Game Collection</h2>
    > > <table border="1">
    > > <xsl:for-each select="lc:Entertainment/GameList">
    > > <tr>
    > > <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    > > </tr>
    > > <tr>
    > > <td>
    > > <xsl:element name="lc:IMG">
    > > <xsl:attribute name="lc:SRC">
    > > <xsl:value-of select="lc:Image"/>
    > > </xsl:attribute>
    > > </xsl:element>
    > > </td>
    > > <td><xsl:value-of select="lc:Description"/></td>
    > > </tr>
    > > </xsl:for-each>
    > > </table>
    > > </xsl:template>
    > > </xsl:stylesheet>


    I took out the <xsl:template match="lc"> in my games.xslt file and
    changed it back to <xsl:template match="/">. In my games.xml file I
    changed
    xmlns="http://mark/DevelopmentWebsite" to
    xmlns:lc="http://mark/DevelopmentWebsite" to match the prefix in my
    ..xslt file. This causes my heading to appear from my HTML but once
    again I go back to getting nothing from my xml file. I have read many
    many tutorials on the internet and I still don't seem to have a clear
    idea of what I am missing.
     
    Mark Constant, Oct 31, 2003
    #10
  11. So, what is your latest xslt code? (I assume that the source.xml hasn't
    changed).


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    "Mark Constant" <> wrote in message
    news:...
    > "Dimitre Novatchev" <> wrote in message

    news:<bnrop8$10ja24$-berlin.de>...
    > > > This is my games.xml file
    > > > <?xml version="1.0" encoding="utf-8" ?>
    > > > <Entertainment xmlns="http://mark/DevelopmentWebsite">
    > > > <GameList>
    > > > <ID>1</ID>
    > > > <Console>PS2</Console>
    > > > <Title>Sly Cooper</Title>
    > > > <Description>A fun game for everybody</Description>
    > > > <Image>images\SlyCooper.jpg</Image>
    > > > </GameList>
    > > > </Entertainment>
    > > >
    > > > This is my games.xslt file
    > > > <?xml version="1.0" encoding="ISO-8859-1"?>
    > > > <xsl:stylesheet version="1.0"
    > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > > > xmlns:lc="http://mark/DevelopmentWebsite">
    > > > <xsl:template match="lc">

    > >
    > > There is no element named "lc" in your source.xml -- this template is

    never
    > > instantiated.
    > >
    > > This completely explains what you get (this is the result of the XSLT
    > > built-in templates) -- just the concatenation of all text nodes.
    > >
    > >
    > > =====
    > > Cheers,
    > >
    > > Dimitre Novatchev.
    > > http://fxsl.sourceforge.net/ -- the home of FXSL
    > >
    > >
    > > > <h2>My Game Collection</h2>
    > > > <table border="1">
    > > > <xsl:for-each select="lc:Entertainment/GameList">
    > > > <tr>
    > > > <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    > > > </tr>
    > > > <tr>
    > > > <td>
    > > > <xsl:element name="lc:IMG">
    > > > <xsl:attribute name="lc:SRC">
    > > > <xsl:value-of select="lc:Image"/>
    > > > </xsl:attribute>
    > > > </xsl:element>
    > > > </td>
    > > > <td><xsl:value-of select="lc:Description"/></td>
    > > > </tr>
    > > > </xsl:for-each>
    > > > </table>
    > > > </xsl:template>
    > > > </xsl:stylesheet>

    >
    > I took out the <xsl:template match="lc"> in my games.xslt file and
    > changed it back to <xsl:template match="/">. In my games.xml file I
    > changed
    > xmlns="http://mark/DevelopmentWebsite" to
    > xmlns:lc="http://mark/DevelopmentWebsite" to match the prefix in my
    > .xslt file. This causes my heading to appear from my HTML but once
    > again I go back to getting nothing from my xml file. I have read many
    > many tutorials on the internet and I still don't seem to have a clear
    > idea of what I am missing.
     
    Dimitre Novatchev, Oct 31, 2003
    #11
  12. "Dimitre Novatchev" <> wrote in message news:<bnt796$15s4da$-berlin.de>...
    > So, what is your latest xslt code? (I assume that the source.xml hasn't
    > changed).
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL


    My xslt code has gone back to
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:lc="http://mark/DevelopmentWebsite">
    <xsl:template match="/">
    <h2>My Game Collection</h2>
    <table border="1">
    <xsl:for-each select="lc:Entertainment/GameList">
    <tr>
    <th colspan="2"><xsl:value-of select="lc:Title"/></th>
    </tr>
    <tr>
    <td>
    <xsl:element name="lc:IMG">
    <xsl:attribute name="lc:SRC">
    <xsl:value-of select="lc:Image"/>
    </xsl:attribute>
    </xsl:element>
    </td>
    <td><xsl:value-of select="lc:Description"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>

    The only thing that has changed in my source.xml file is I changed my
    default namespace from xmlns="http://mark/DevelopmentWebsite to
    xmlns:lc="http://mark/DevelopmentWebsite so it can match the prefix in
    my xslt file. The xslt file above is only outputting my heading from
    my HTML code and nothing else. By the way thank you for helping me
    this far. I have been on many forums and usually I have seen that the
    most knowledgable people on the forum give new-comers a tough time.
     
    Mark Constant, Oct 31, 2003
    #12
  13. > My xslt code has gone back to
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:lc="http://mark/DevelopmentWebsite">
    > <xsl:template match="/">
    > <h2>My Game Collection</h2>
    > <table border="1">
    > <xsl:for-each select="lc:Entertainment/GameList">


    Here's the problem:

    lc:Entertainment/GameList

    will not select any node, because there isn't any element named "GameList"
    belonging to no namespace.

    Must be:

    lc:Entertainment/lc:GameList

    [snip]

    > The only thing that has changed in my source.xml file is I changed my
    > default namespace from xmlns="http://mark/DevelopmentWebsite to
    > xmlns:lc="http://mark/DevelopmentWebsite so it can match the prefix in
    > my xslt file.


    This was not necessary -- with the correction above the transformation will
    work on your original xml document.

    Why? Because in selecting/matching elements what is important is not the
    prefix used but that the expanded name (namespace-uri, local-name() ) is the
    same.



    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
     
    Dimitre Novatchev, Oct 31, 2003
    #13
  14. "Dimitre Novatchev" <> wrote in message news:<bnu550$157slu$-berlin.de>...
    > > My xslt code has gone back to
    > > <?xml version="1.0" encoding="ISO-8859-1"?>
    > > <xsl:stylesheet version="1.0"
    > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > > xmlns:lc="http://mark/DevelopmentWebsite">
    > > <xsl:template match="/">
    > > <h2>My Game Collection</h2>
    > > <table border="1">
    > > <xsl:for-each select="lc:Entertainment/GameList">

    >
    > Here's the problem:
    >
    > lc:Entertainment/GameList
    >
    > will not select any node, because there isn't any element named "GameList"
    > belonging to no namespace.
    >
    > Must be:
    >
    > lc:Entertainment/lc:GameList
    >
    > [snip]
    >
    > > The only thing that has changed in my source.xml file is I changed my
    > > default namespace from xmlns="http://mark/DevelopmentWebsite to
    > > xmlns:lc="http://mark/DevelopmentWebsite so it can match the prefix in
    > > my xslt file.

    >
    > This was not necessary -- with the correction above the transformation will
    > work on your original xml document.
    >
    > Why? Because in selecting/matching elements what is important is not the
    > prefix used but that the expanded name (namespace-uri, local-name() ) is the
    > same.
    >
    >
    >
    > =====
    > Cheers,
    >
    > Dimitre Novatchev.
    > http://fxsl.sourceforge.net/ -- the home of FXSL



    Thank you so much Dimitre! It works perfectly.
     
    Mark Constant, Nov 1, 2003
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,107
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    491
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    863
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    793
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Replies:
    1
    Views:
    528
    Henry S. Thompson
    Jun 30, 2004
Loading...

Share This Page