473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

XSL matches in RSA/eclipse, not with Xalan 2.5.1

hi there

i have developed a style sheet that works fine in the XML perspective
of Rational Software architect, but when i add it to my application, it
appears to match no nodes.

my XSL that matches nodes looks like this:

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:xalan="http://xml.apache.org/xslt"
xmlns:crm="http://w3.ibm.com/xmlns/ibmww/crm"
xmlns:ci="http://w3.ibm.com/xmlns/ibmww/ci"
xmlns:foo="http://w3.ibm.com/xmlns/ibmww/com"
exclude-result-prefixes="foo ci crm xalan">

<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<locations>
<xsl:apply-templates select="//foo:Geography" />
</locations>
</xsl:template>

<xsl:template match="foo:Geography">
<xsl:for-each select="descendant:: //blah blah

and we're fine from there : i get a lot of <location> child elements of
my parent <locations> element, so the select="//foo:Geography" and the
match are working ok. but then i run it inside my java app which has
specific libs from xalan/xerces ( the DOM is the input XML instance and
that is fine, and the stylesheet is correctly located):

private String getLocations(Document source) throws Exception{

Writer writer = new StringWriter();
InputStream styleSheet =
this.getClass().getResourceAsStream("/locations.xsl");

TransformerFactory transFactory = TransformerFactory.newInstance();
Templates template =
transFactory.newTemplates(new StreamSource(styleSheet));

Transformer transformer = template.newTransformer();

DOMSource domSource = new DOMSource(source);

transformer.transform(
domSource,
new javax.xml.transform.stream.StreamResult(writer));
String result = writer.toString();
return result;
}

i get an empty instance : basically like this:

<locations />

i am wondering if its a namespaces issue? it seems to me that
<xsl:apply-templates select="//foo:Geography" />

is matching no nodes in the application, but plenty in the IDE. can
anyone help here? do i need to inform the API classes more
specifically about the namespace?

regs and tia,

peter

Jul 20 '05 #1
1 1640
i got around it with this post:

http://groups-beta.google.com/group/...0084b2ebca84ef

pg******@uk.ibm.com wrote:
hi there

i have developed a style sheet that works fine in the XML perspective
of Rational Software architect, but when i add it to my application, it
appears to match no nodes.
<snipped....>


Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: al dav | last post by:
Hi all ok i am not a java programmer I am a sys-admin, my users want xalan and have already got j2sdk_1.4.2 so i have downloaded it and set the CLASS_PATH export...
1
by: Fisch von Gestern | last post by:
I have tried to run the extension function/element examples provided with the Xalan-J download. I believe that my classpath is correct, and that my versions are up-to-date. However, I can't get...
7
by: Ganesh Gella | last post by:
Hi All, I am planning to use Xalan to transform XML data by applying xls stylesheets. Here tricky part is, Xalan provides several C++ APIs, which are very much useful if our requirement is...
2
by: Dr. Roger Wießner | last post by:
Hello! I am a newbie to XSLT and need a freeware/GNU Tool to get experience with this new topic. Which one is a good XSLT? Xalan or Saxon, or which one else? Thank you a lot!
5
by: John | last post by:
I'm trying to generate HTML using a SAX TransformHandler. The problem I'm having is related to the xalan transformer using the shorthand notation when it writes out an empty textarea tag. My...
7
by: RC | last post by:
First, let me say I couldn't find a group discuss XML/XSLT. So I only choose the closest groups to post this message. Here is part of my *.xsl file <xsl:stylesheet...
0
by: terry.jeske | last post by:
Hello, I am trying to upgrade an application that was previously running on Xalan 1.4.2, to 2.7.0. I have worked out the build issues and now the application compiles with the new xalan and...
3
by: Avalon1178 | last post by:
Hi, I recently downloaded the xalan-c source code in http://mirrors.ccs.neu.edu/Apache/dist/xml/xalan-c I followed the instructions from the apache site on how to build it (I already have...
2
by: henribastien | last post by:
I'm trying to return an array from a xalan extension but so far I have made no progress. What I would like to return is something like that <entry id="red">201</entry> <entry...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.