XML

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • A request for some help with ambigious error messages and xslt stylesheets

    6 answers - 9143 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello all,
    First let me thank you in advance. I cannot seem to decode the w3c.org
    documents, or so would my relative sucess indicate.
    My primary goal:
    I am trying to make an RSS feed with a couple of additional tags and
    additional namespaces as allowed by the document.
    My error here is that the RSS validator and the w3c validator both will
    not reconize the XML reserverd xmlns attributes and thusly throw errors
    for the xmlns prefixed tags.
    My seccondary goal:
    I want to use an XSLT stylesheet to transform this RSS feed into XHTML
    1.0 transitional for web browsers.
    My problem here is even more odd. My stylesheet used to work in Firefox
    but now all I get is "Error loading stylesheet: (null)", and before that
    I would get an XPath error because of the different xmlns namespaces.
    The third question I have is purely academic: the RSS validator calims
    that I should not have system DCTYPES in a feed, as well as
    capitalization in tags: is this a good idea and can I ignore it? (e.g.
    <webmasteris not valid but <webMasteris - why?)
    I have included sample XML+RSS and XSLT pages at the foot of this email,
    and they can also be viewed at
    and
    respectively.
    Thank you for your help! Also any good online resorces you can point me
    too would be greatly appreciated!
    -thewade
    PS: are html emails appreciated on this list, or should I stick with
    plain text?
    aproximation.audio.xml
    <?xml version="1.0"?>
    <!DCTYPE rss SYSTEM "">
    <?xml-stylesheet media="screen" title="web browser view" href="" type="text/xml"?>
    <rss version="2.0">
    <channel xmlns:aprox="" xmlns:html="http://www.w3.org/1999/xhtml">
    <title>audio</title>
    <link></link>
    <description>Experimental noise/industrial/minimal audio based works and auditory code art of/by thewade A.K.A. aproximation A.K.A. Wade McDaniel</description>
    <aprox:keywords>aproximation, thewade, Wade McDaniel, music, noise, experimental, procedural, art, audio, aural, sound, code</aprox:keywords>
    <language>en-us</language>
    <pubDate>Mon, 28 Nov 2005 20:59:49 -0800</pubDate>
    <lastBuildDate>Mon, 28 Nov 2005 20:59:08 -0800</lastBuildDate>
    <generator>aproximation feed 1.0</generator>
    <managingEditor>editor (AT) audio (DOT) aproximation.org</managingEditor>
    <webMaster>webMaster (AT) aproximation (DOT) org</webMaster>
    <item>
    <title>sonig(v2)Mod</title>
    <pubDate>Wed, 01 Dec 2004 22:54:00 -0800</pubDate>
    <link>(v2)Mod.mp3</link>
    <aprox:image></aprox:image>
    <description>size: 4.1 Mb<html:br /></description>
    <guid isPermaLink="true"></guid>
    </item>
    <item>
    <title>sonig(v2)</title>
    <pubDate>Fri, 01 Aug 2003 15:00:00 -0700</pubDate>
    <link></link>
    <aprox:image></aprox:image>
    <description>size: 2.7 Mb<html:br />
    length: 2:57<html:br />
    For this track I recorded Maggie Mayhem's sister, Leslie, playing the violin. I then used synthsis techniques not unlike violin playing to move back and forth across the sample to make a signal. I used <html:a href="http://iem.kug.ac.at/pd/">PD 0.36</html:a>, a magnificent little program. Meta-violin.</description>
    <guid isPermaLink="true"></guid>
    </item>
    </channel>
    </rss>
    aproximation.audio.xslt
    <xsl:stylesheet version="1.0"
    xmlns:xsl="">
    <xsl:output method="html" indent="yes" encoding="iso-8859-1" />
    <xsl:template match="rss">
    <html>
    <head>
    <title>aproximation <xsl:value-of select="channel/title"/></title>
    <link href="" rel="alternate" type="application/rss+xml" title="aproximation: images" />
    <link rel="stylesheet" type="text/css" href=""/>
    <link rel="stylesheet" type="text/css" href="css.php"/>
    <xsl:variable name="description">
    <xsl:value-of select="channel/description"/>
    </xsl:variable>
    <xsl:variable name="keywords">
    <xsl:value-of select="channel/aprox:keywords"/>
    </xsl:variable>
    <xsl:variable name="language">
    <xsl:value-of select="channel/language"/>
    </xsl:variable>
    <xsl:variable name="generator">
    <xsl:value-of select="channel/generator"/>
    </xsl:variable>
    <xsl:variable name="managingeditor">
    <xsl:value-of select="channel/managingEditor"/>
    </xsl:variable>
    <xsl:variable name="webmaster">
    <xsl:value-of select="channel/webMaster"/>
    </xsl:variable>
    <xsl:variable name="pubdate">
    <xsl:value-of select="channel/pubDate"/>
    </xsl:variable>
    <xsl:variable name="lastpubdate">
    <xsl:value-of select="channel/lastPubDate"/>
    </xsl:variable>
    <meta name="description" content="{$description}"/>
    <meta name="keywords" content="{$keywords}"/>
    <meta name="language" content="{$language}"/>
    <meta name="generator" content="{$generator}"/>
    <meta name="managingeditor" content="{$managingeditor}"/>
    <meta name="webmaster" content="{$webmaster}"/>
    <meta name="managingeditor" content="{$pubdate}"/>
    <meta name="webmaster" content="{$lastpubdate}"/>
    </head>
    <body>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>
    <!-- channel templates
    <xsl:template match="channel">
    <div class="channel">
    <xsl:apply-templates/>
    </div>
    </xsl:template>
    <!-- channel blanks
    <xsl:template match="channel/description">
    </xsl:template>
    <xsl:template match="channel/aprox:keywords">
    </xsl:template>
    <xsl:template match="channel/language">
    </xsl:template>
    <xsl:template match="channel/docs">
    </xsl:template>
    <xsl:template match="channel/generator">
    </xsl:template>
    <xsl:template match="channel/webMaster">
    </xsl:template>
    <xsl:template match="channel/link">
    </xsl:template>
    <!-- item templates
    <xsl:template match="item">
    <div class="item">
    <xsl:apply-templates/>
    </div>
    </xsl:template>
    <xsl:template match="channel/title">
    <h1>
    <a>
    <xsl:attribute name="href">
    <xsl:text>http://</xsl:text>
    <xsl:value-of select="."/>
    <xsl:text>.aproximation.org/</xsl:text>
    </xsl:attribute>
    <xsl:text>aproximation </xsl:text>
    <xsl:value-of select="."/>
    </a>
    </h1>
    </xsl:template>
    <xsl:template match="channel/managingEditor">
    <a>
    <xsl:attribute name="href">
    mailto:<xsl:value-of select="."/>
    </xsl:attribute>
    editor</a>
    </xsl:template>
    <xsl:template match="item/title">
    <h2><xsl:value-of select="."/></h2>
    </xsl:template>
    <xsl:template match="pubDate">
    <b>Published: <xsl:value-of select="."/></b>
    </xsl:template>
    <xsl:template match="lastBuildDate">
    <b><i>Last updated: <xsl:value-of select="."/></i></b>
    </xsl:template>
    <xsl:template match="description">
    <p class="description"><xsl:value-of select="."/></p>
    </xsl:template>
    <xsl:template match="guid">
    <i class="hidden"><xsl:value-of select="."/></i>
    </xsl:template>
    <xsl:template match="aprox:image">
    </xsl:template>
    <!-- this part turns links + image + titles into <a href's
    <xsl:template match="link">
    <xsl:variable name="src">
    <xsl:text>http://</xsl:text>
    <xsl:value-of select="//title"/>
    <xsl:text>.aproximation.org/</xsl:text>
    <xsl:value-of select="/aprox:image"/>
    </xsl:variable>
    <a>
    <xsl:attribute name="href">
    <xsl:text>http://</xsl:text>
    <xsl:value-of select="//title"/>
    <xsl:text>.aproximation.org/?guid=</xsl:text>
    <xsl:value-of select="/guid"/>
    </xsl:attribute>
    <img src="{$src}" />
    </a>
    </xsl:template>
    </xsl:stylesheet>
    The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
    initiative of ASIS <http://www.oasis-open.org>
    The list archives are at
    To subscribe or unsubscribe from this list use the subscription
    manager: <>
  • No.1 | | 677 bytes | |

    Fri, Dec 23, 2005 at 04:06:53PM -0800, thewade wrote:
    I am trying to make an RSS feed with a couple of additional tags and
    additional namespaces as allowed by the document.

    Your DTD does not allow the xmlns:aprox attribute -- delcare it
    as CDATA #IMPLIED on the channel element, and similarly for the
    xmlns:html attribute.

    However, in practice with RSS, you can't put markup inside the
    description element -- instead, you need to escape it, e.g. with
    a CDATA section or with numeric character references or entities --
    instead of <html:a href="xxxx"use <a href="xxx">

    Yes, this is sucky almost beyond belief.

    Liam
  • No.2 | | 2188 bytes | |

    Liam Quin wrote:

    Fri, Dec 23, 2005 at 04:06:53PM -0800, thewade wrote:

    >
    >>I am trying to make an RSS feed with a couple of additional tags and
    >>additional namespaces as allowed by the document.

    >
    >>

    >
    >Your DTD does not allow the xmlns:aprox attribute -- delcare it
    >as CDATA #IMPLIED on the channel element, and similarly for the
    >xmlns:html attribute.


    I thought this was inherent to XML though, like how we don't need a
    namespace for the < and characters well, I made the change but
    it seems like a kludge too me.

    >However, in practice with RSS, you can't put markup inside the
    >description element -- instead, you need to escape it, e.g. with
    >a CDATA section or with numeric character references or entities --
    >instead of <html:a href="xxxx"use <a href="xxx">


    Who comes up with the rules for RSS?

    >Yes, this is sucky almost beyond belief.


    Hear hear!
    So if I have a large piece of text I was syndicating it just needs to
    all run together into some large run-on paragraph? Sounds like a bad
    idea to me, and that is why I am going to keep using markup in my
    descriptions. Thunderbird's RSS reader likes my markup, though not my
    javascript.

    Thanks for the verification! I tried that and the validator passed that
    point (http://feedvalidator.org) but it didnt look right.

    Also, I have been using an items attribute in the channel tag that holds
    the count of all the items in a channel (or in a specific search) for
    use in a javascript frontend I am writing. course the validator
    doesnt like this either. I have yet to test it out on Thunderbird

    Thanks again!
    -thewade

    The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
    initiative of ASIS <http://www.oasis-open.org>

    The list archives are at

    To subscribe or unsubscribe from this list use the subscription
    manager: <>
  • No.3 | | 2279 bytes | |

    derek denny-brown wrote:

    >I'm not sure what RSS validators you tried, but if you are using the
    >W3C's validator, it is probably using the DTD to validate your
    >document, and DTDs do not support using namespaces in places that the
    >DTD explicitly supports. (DTDs predate namespaces.)


    Hmm. Thanks! I see that I forgot to put in the two resources I was using
    to fix my feed: http://feedvalidator.org and

    So I guess I am confused as to what a namespace is? I thought a DTD WAS
    a namespace, as it describes all the possible names and configurations
    of names used in a piece of markup. What is a namespace?

    >I can't help you with your xslt problem, but you might try using an
    >alternate xslt implementation, as my experience with Firefox's XSLT is
    >that it's error handling is extremely difficult to debug. I usually
    >fall back to IE or a java xslt processor.


    IE wasn't doing my XML correctly, much less XSLT. All I got was code,
    even when Firefox was partially transforming my XML into XHTML.
    Is there a plugin I need for IE?
    What tools do you use?

    >As to your last question: XML tags are case sensitive. The reason is
    >that it is next to impossible to be case-insensitive and language
    >neutral as different locales have different rules for how to
    >case-convert various letters. famous example is known as the
    >'Turkish I' problem. Here is a blog about it (just google for more
    >info):


    , interesting. I hadn't thought about other languages. I might sound
    xenocentric, but I always imagined people programming in English in
    other countiries. I wonder if the hello world program looks like this in
    German C?
    #umfassen <nrmlio.h//Normal I

    nichts main() {
    schreibf("hallo welt!");
    }

    Thanks for the help!
    -thewade

    The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
    initiative of ASIS <http://www.oasis-open.org>

    The list archives are at

    To subscribe or unsubscribe from this list use the subscription
    manager: <>
  • No.4 | | 1472 bytes | |

    Hi again,

    So with a little help I have discovered where I am breaking the RSS
    rules, but I still have three questions:
    1. how do I get an XSLT transformation to match this tag?
    <aprox:image>lalala</aprox:image>
    because this gets me an xpath error
    <xsl:template match="aprox:image">
    </xsl:template>
    (where the tag <imageand the match="image" works)

    2.What is the point of the xmlns:aprox when I have to declare all my
    elements in the root DTD in order to be valid XML?

    3. What exactly is a namespace if not a DTD. Because the w3c xhtml
    namespace appears to be a page that itself links to a DTD and otherwise
    had no code value.

    For examples you can see two examples:
    http://audio.aproximation.org almost works - it at least formats a bit
    in Firefox but I still can match the prefixed tags.
    has the XSLT file the way it
    "should" work but I get an ambigious error message in Firefox and XMLspy
    (which seems kinda lame) says I have an XPath error with my
    aprox:keywords matching.

    So the first question is most important, the second two are academic.

    Thanks again for your time!
    -thewade

    The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
    initiative of ASIS <http://www.oasis-open.org>

    The list archives are at

    To subscribe or unsubscribe from this list use the subscription
    manager: <>
  • No.5 | | 190 bytes | |

    Liam Quin wrote:
    Yes, this is sucky almost beyond belief.
    So sucky I recommend that anyone who needs to do this move to Atom 1.0
    and reserve RSS for simple, text-only feeds.
  • No.6 | | 1751 bytes | |

    Fri, Dec 23, 2005 at 10:42:22PM -0800, thewade wrote:
    3. What exactly is a namespace if not a DTD. Because the w3c xhtml
    namespace appears to be a page that itself links to a DTD and otherwise
    had no code value.

    A namespace is a binding between a set of names and a URI.
    The purpose is to let software recognise when two names are
    the same and when they are different. This (for example) makes it
    possible to combine fragments of different vocabularies using
    (almost) cut and paste (if you add the namespace declarations)
    to make meaningless gibberish without conflict between names.

    The namespaces recommendation says nothing about DTDs or
    schemas of any kind, and indeed nothing about what you get if
    you try to defererence a namespace URI.

    You could think of namespaces in XML as like namespaces in C++,
    or qualified names in Perl, e.g. modulename::name, except that
    it's entirely at the syntax level, so there's not really a concept
    of an undefined name as there is in C++ or Perl.

    You can't write a DTD that understands namespaces, but you can write
    one that will validate if you use a particular prefix. You can even
    parameterise the prefix, so you have to add a declaration like
    <!ENTITY % prefix "xxx">
    in your document (which will make many XML processors ignore the rest
    of your internal subset and will make Web browsers take off their
    shirts and run around screaming the lyrics from Hiawatha).

    it's best to avoid DTDs when namespaces are involved :(

    So the first question is most important, the second two are academic.
    I'll answer just the third, then, since this is xml-dev :-)

    Best,

    Liam

Re: A request for some help with ambigious error messages and xslt stylesheets


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "XML"

EMSDN.COM