Xerces parser and XSL

Discussion in 'XML' started by M Arora, Nov 18, 2005.

  1. M Arora

    M Arora Guest

    Hi All

    I am using Xerces parser to convert my xml to the output given below
    and for this i am using the xslt. How shall i create href attribute in
    xerces parser?

    When i am using MSDOM parser the output is whats requied. But if Xerces
    parser is used then no attribute withe name href is created.

    Can any one suggest what need to to be done.

    output with DOM parser
    <a href ="www.google.com">www.google.com</a>

    output with Xerces parser
    <a>www.google.com</a>

    template in xsl is :
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="@link"/>
    </xsl:attribute>
    <xsl:value-of select=./>
    </a>
    M Arora, Nov 18, 2005
    #1
    1. Advertising

  2. M Arora wrote:

    > I am using Xerces parser to convert my xml to the output given below
    > and for this i am using the xslt. How shall i create href attribute in
    > xerces parser?


    XSLT is not in any way done by the Xerces parser, thus if some XSLT
    stylesheet is not giving you the output you want you should look into
    the XSLT processor used.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Nov 18, 2005
    #2
    1. Advertising

  3. M Arora

    M Arora Guest

    But I am getting the correct ouput with DOM Parser but not with java
    Xerces parser. Can you suggest me whats the difference
    M Arora, Nov 19, 2005
    #3
  4. M Arora wrote:

    > But I am getting the correct ouput with DOM Parser but not with java
    > Xerces parser. Can you suggest me whats the difference


    DOM Parser? In Java? Xerces is one implementation of that if DOM Parser
    refers to
    <http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html>
    But you are talking about problems with the output of an XSLT stylesheet
    and Xerces is a parser and not an XSLT processor so you need to find out
    which XSLT processor you use to get that output.
    If you are using the standard Java 1.4/1.5 APIs to perform an XSLT
    transformation then you would use javax.xml.transform.TransformerFactory
    to create an implementation of javax.xml.transform.Transformer. Which
    implementation is actually used when you run a Java program depends on
    certain properties respectively the class path.
    See
    <http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/TransformerFactory.html#newInstance()>

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Nov 19, 2005
    #4
  5. M Arora

    M Arora Guest

    Hi

    Thanks for making an effort to find the solution with me. I tried
    creating the HTMl tags for the output and it worked. It was not a
    problem of Xerces parser.

    Thanks once again
    M Arora, Nov 21, 2005
    #5
    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. Kevin Flood
    Replies:
    0
    Views:
    1,008
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,712
    Kevin Flood
    Sep 13, 2004
  3. Sylwester Ba³a

    Xerces parser XML and Visual C++ 6.0

    Sylwester Ba³a, Jul 22, 2003, in forum: XML
    Replies:
    2
    Views:
    946
    Sylwester Ba³a
    Jul 23, 2003
  4. cvissy
    Replies:
    0
    Views:
    599
    cvissy
    Nov 16, 2004
  5. Replies:
    1
    Views:
    3,582
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page