Xerces parser and XSL

M

M Arora

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

Martin Honnen

M said:
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.
 
M

M Arora

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

Martin Honnen

M said:
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()>
 
M

M Arora

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
 

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,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top