Re: Uppercasing embedded tags in XSL

Discussion in 'XML' started by Klaus Johannes Rusch, Sep 1, 2003.

  1. Joel Thornton wrote:

    > I have an XSL template which takes as a parameter a string, and
    > transforms it into an XML tree based on the tags embedded in it, e.g.
    > "<B>hello <U>there</U></B>" gets transformed into the corresponding
    > XML tree. (I am using this to turn double-carriage-returns into
    > <br/></br/> for HTML string content.)
    >
    > The problem I am encountering is in the embedded tags' case. If the
    > case doesn't match between two matched tags, my template doesn't work.
    > So,
    >
    > <B>hello</B> - works fine, but
    > <B>hello</b> - breaks things.
    >
    > Can anybody suggest how I can make my template routine fix the case of
    > these tags so it works as desired?


    You cannot, at least not with a standards conforming XML parser, which
    MUST fail if the document is not well-formed. You will need to preprocess
    the document to fix these errors (or use your own parser and do the
    transformation to consistent case before passing the document tree to the
    XSLT processor).

    --
    Klaus Johannes Rusch

    http://www.atmedia.net/KlausRusch/
     
    Klaus Johannes Rusch, Sep 1, 2003
    #1
    1. Advertising

  2. Klaus Johannes Rusch <> wrote:
    : You cannot, at least not with a standards conforming XML parser, which
    : MUST fail if the document is not well-formed. You will need to preprocess
    : the document to fix these errors (or use your own parser and do the
    : transformation to consistent case before passing the document tree to the
    : XSLT processor).

    Or use an SGML parser and make it produce a normalized document.
    (Since HTML documents, as opposed to XHTML documents, are not bound by
    the XML restrictions on markup, the mentioned errors are errors only in
    an XML sense.)


    Georg
     
    Georg Bauhaus, Sep 1, 2003
    #2
    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. Greg Smith
    Replies:
    35
    Views:
    3,194
    Alex Kay
    Oct 24, 2004
  2. slberry
    Replies:
    0
    Views:
    418
    slberry
    May 15, 2004
  3. Replies:
    1
    Views:
    3,637
    A. Bolmarcich
    May 27, 2005
  4. Replies:
    0
    Views:
    569
  5. Colin Paul Gloster
    Replies:
    48
    Views:
    1,910
    Colin Paul Gloster
    Apr 10, 2007
Loading...

Share This Page