[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: parsing xsl file in java


java parsing with xsl include
Take a look at the JAXP interface, specifically the classes in
javax.xml.parsers and javax.xml.transform.

There's a choice of products that implement this interface, e.g. Saxon,
Xalan, Oracle, jd.xslt

JAXP itself doesn't currently provide a method like selectNodes() to execute
an XPath expression against a DOM, but many products have such a method.

However, the approach you are using of modifying the stylesheet on the fly
before running it is very inefficient in a servlet environment, because it
means you have to compile the stylesheet each time it's used. This is not a
design I would recommend. But to give you a preferred design, I would need
to know what you are trying to achieve.

Generally the xsl-list at mulberrytech.com is a better place for this kind
of question.

Michael Kay

# -----Original Message-----
# From: Zahida Parveen [mailto:zahida@a...]
# Sent: 27 February 2004 11:17
# Cc: xml-dev@l...
# Subject:  parsing xsl file in java
# 
# Thanx to all who answered my previous query "parsing xsl file in java".
# Let
# me explain again what I want to know. Below is a code segment in ASP:
# 
# 1.  set  style = Server.CreateObject("MSXML2.DOMDocument")
# 2.  style.async = false
# 3.  style.setProperty
# "SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"
# 4.  style.load styleFile
# 
# 5.  Set objRoot = style.documentElement
# 6.  Set objField =
# style.selectSingleNode("/xsl:stylesheet/xsl:include[@href='INCLUDEPATH']")
# 7.  objField.setAttribute "href", IncTemplatePath
# 
# >From this code you can see that an xsl file named "styleFile" is loaded
# by
# parser. On line # 6, the xsl:include node whose attribute
# href='INCLUDEPATH'
# is read. On line # 7, its attribute href is assigned a new value from
# variable IncTemplatePath.
# 
# I want to do this whole thing done in ASP code above, in Java Servlets. I
# am
# new to Java Servlets and dont have much idea about Java Parsers also. I
# have
# heard about Xalan. Is it FREE. How to install and configure to use it.
# 
# Please help me to do this thing. I ll be waiting for response from all of
# you.
# 
# Thanks,
# Zahida
# 
# 
# -----------------------------------------------------------------
# The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
# initiative of OASIS <http://www.oasis-open.org>
# 
# The list archives are at http://lists.xml.org/archives/xml-dev/
# 
# To subscribe or unsubscribe from this list use the subscription
# manager: <http://www.oasis-open.org/mlmanage/index.php>




PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.