xml:stylesheet use in document with multiple stylesheet options

Discussion in 'XML' started by David Blickstein, Aug 2, 2005.

  1. Hi,

    I have a Schema and a number of different XSLT stylesheets to translate to
    different things. One stylesheet translates it to HTML.

    I'd like to generate the XML files such that when loaded by a browser they
    are automatically translated into XML and I've accomplished that by
    inserting the following processing instruction when I generate the file:

    <?xml:stylesheet type="text/xsl" href="toHtml.xslt" version="1.0"?>


    However I would also like to arrange things such that I can use OTHER XSLT
    stylesheets on the XML file by manually invoking XSLT.

    However, when I try to use another stylesheet on an XML file with that
    processing instruction I get the following error msg from XALAN:

    file:///extra/blickstein/user_150_GIRML/CLO/Components/JAVA_HOTSPOT/Src/build/hp-ux/hp-ux_ia64w_compiler3/debug/girml.xml;
    Line #2; Column #6; XSLT Error (javax.xml.transform.TransformerException):
    The processing instruction target matching "[xX][mM][lL]" is not allowed.

    Is there a way to have a sort of "default" stylesheet specified via a
    processing instruction without making the file unuseable with a different
    stylesheet?
     
    David Blickstein, Aug 2, 2005
    #1
    1. Advertising

  2. David Blickstein wrote:

    > <?xml:stylesheet type="text/xsl" href="toHtml.xslt" version="1.0"?>


    According to <http://www.w3.org/1999/06/REC-xml-stylesheet-19990629/> it is

    xml-stylesheet

    And that's what Xalan tells you:

    > file:///extra/blickstein/user_150_GIRML/CLO/Components/JAVA_HOTSPOT/Src/build/hp-ux/hp-ux_ia64w_compiler3/debug/girml.xml;
    > Line #2; Column #6; XSLT Error (javax.xml.transform.TransformerException):
    > The processing instruction target matching "[xX][mM][lL]" is not allowed.


    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Aug 2, 2005
    #2
    1. Advertising

  3. David Blickstein wrote:


    > <?xml:stylesheet type="text/xsl" href="toHtml.xslt" version="1.0"?>


    It should be
    <?xml-stylesheet
    not
    <?xml:stylesheet
    see the spec here:
    <http://www.w3.org/TR/xml-stylesheet/>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Aug 2, 2005
    #3
  4. > It should be
    > <?xml-stylesheet
    > not
    > <?xml:stylesheet


    Ugh... I had copied that from a website I had googled.

    Turns out... the colon works with IE anyway, but IE seems just as happy with
    a hyphen and XALAN is MUCH happier with a hyphen.

    Thanks for the help guys.
     
    David Blickstein, Aug 2, 2005
    #4
    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. Tony Prichard
    Replies:
    0
    Views:
    751
    Tony Prichard
    Dec 12, 2003
  2. Manish Hatwalne
    Replies:
    1
    Views:
    404
    Martin Honnen
    Jul 13, 2004
  3. UndoMiel
    Replies:
    1
    Views:
    421
    Keith M. Corbett
    Sep 21, 2004
  4. Michael Hertz
    Replies:
    3
    Views:
    10,297
    Martin Honnen
    Oct 4, 2004
  5. Steven An
    Replies:
    1
    Views:
    512
    Martin Honnen
    Nov 23, 2004
Loading...

Share This Page