XSLT: not matching anything

Discussion in 'XML' started by Ian, Jan 28, 2005.

  1. Ian

    Ian Guest

    Would someone please take a look at http://www.otima.ca/XML/auto.xslt
    and tell me why I am not getting to the

    <xsl:template match="auto">
    <p><xsl:value-of select="."/></p>
    </xsl:template>

    Let me say, I am building this xslt document one step and a time ...
    and at this point I haven't got up to the baby step yet. The
    associated XML file is in the same folder and is called auto.xml.

    Signed a student in need.

    Ian
    Ian, Jan 28, 2005
    #1
    1. Advertising

  2. On 27 Jan 2005 20:53:19 -0800, Ian <> wrote:

    > The associated XML file is in the same folder and is called
    > auto.xml.


    The file at:

    http://www.otima.ca/XML/auto.xml

    is not well-formed. (There's a '</auto>' on line 64 with no
    corresponding start tag.) Further, you've specified a namespace for
    your source document (http://www.otima.ca), but not for the elements
    to match in your template in the XSLT. You need to declare the
    namespace in your XSLT, and then qualify the element names with it.
    For example,

    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:foo="http://www.otima.ca">
    ....
    <xsl:apply-templates select="foo:dealership/foo:auto"/>
    ....


    --
    Paul.

    Logic Squad -- Technical Publishing with XML -- http://logicsquad.net/
    Paul A. Hoadley, Jan 28, 2005
    #2
    1. Advertising

  3. Ian

    Guest

    Hi Paul,

    Thank you for pointing out the extra </auto> tag, I am working on a
    localhost and then I pasting it (incorrectly) over to my net copy when
    I need help.

    I have made the changes as indicated and life is good. (I am taking
    XML at a local university and the teacher is not a subject matter
    expert. Luckily, due to class complaints, he won't be teaching the
    advanced XML).

    Thanks for the lesson!

    Ian

    Paul A. Hoadley wrote:
    > On 27 Jan 2005 20:53:19 -0800, Ian <> wrote:
    >
    > > The associated XML file is in the same folder and is called
    > > auto.xml.

    >
    > The file at:
    >
    > http://www.otima.ca/XML/auto.xml
    >
    > is not well-formed. (There's a '</auto>' on line 64 with no
    > corresponding start tag.) Further, you've specified a namespace for
    > your source document (http://www.otima.ca), but not for the elements
    > to match in your template in the XSLT. You need to declare the
    > namespace in your XSLT, and then qualify the element names with it.
    > For example,
    >
    > <?xml version="1.0" encoding="iso-8859-1"?>
    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > xmlns:foo="http://www.otima.ca">
    > ...
    > <xsl:apply-templates select="foo:dealership/foo:auto"/>
    > ...
    >
    >
    > --
    > Paul.
    >
    > Logic Squad -- Technical Publishing with XML --

    http://logicsquad.net/
    , Jan 28, 2005
    #3
    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. Replies:
    3
    Views:
    815
  2. Marc Bissonnette

    Pattern matching : not matching problem

    Marc Bissonnette, Jan 8, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    220
    Marc Bissonnette
    Jan 13, 2004
  3. Bobby Chamness
    Replies:
    2
    Views:
    213
    Xicheng Jia
    May 3, 2007
  4. PerlFAQ Server

    FAQ 4.23 How do I find matching/nesting anything?

    PerlFAQ Server, Jan 2, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    82
    PerlFAQ Server
    Jan 2, 2011
  5. PerlFAQ Server

    FAQ 4.23 How do I find matching/nesting anything?

    PerlFAQ Server, Apr 2, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    72
    PerlFAQ Server
    Apr 2, 2011
Loading...

Share This Page