XSLT: not matching anything

I

Ian

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
 
P

Paul A. Hoadley

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"/>
....
 
I

ian.rutgers

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
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"/>
...
http://logicsquad.net/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top