Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Xerces parser and XSL

Reply
Thread Tools

Xerces parser and XSL

 
 
M Arora
Guest
Posts: n/a
 
      11-18-2005
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>

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-18-2005


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/
 
Reply With Quote
 
 
 
 
M Arora
Guest
Posts: n/a
 
      11-19-2005
But I am getting the correct ouput with DOM Parser but not with java
Xerces parser. Can you suggest me whats the difference

 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      11-19-2005


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/
 
Reply With Quote
 
M Arora
Guest
Posts: n/a
 
      11-21-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 1 09-13-2004 02:28 PM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 0 09-08-2004 02:11 PM
Xerces parser XML and Visual C++ 6.0 Sylwester Bała XML 2 07-23-2003 09:48 AM



Advertisments