473,770 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:styleshe et
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:xalan="ht tp://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:Geog raphy">
<xsl:for-each select="descend ant:: //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(Do cument source) throws Exception{

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

TransformerFact ory transFactory = TransformerFact ory.newInstance ();
Templates template =
transFactory.ne wTemplates(new StreamSource(st yleSheet));

Transformer transformer = template.newTra nsformer();

DOMSource domSource = new DOMSource(sourc e);

transformer.tra nsform(
domSource,
new javax.xml.trans form.stream.Str eamResult(write r));
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 1669
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
4031
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 CLASS_PATH=/usr/local/java/xalan-j_2_5_2/bin/xalan.jar:/usr/local/java/xalan -j_2_5_2/bin/xml-apis.jar:/usr/local/java/xalan-j_2_5_2/bin/xercesImpl.jar:/
1
2308
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 past the following error. Any help, please? =========================================================================== C:\xalan>test C:\xalan>REM @echo off
7
2145
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 just inputting a file and getting a file. Or giving a xerces dom and get a new xerces dom. I would like to know whether any of you tried with their own custom
2
2111
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
1781
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 code works fine when xalan.jar is not in my classpath. But when xalan.jar is in the classpath, the generated html incorrectly uses the shorthand notation for writing out an empty textarea tag. Correct output: C:\test>java Test
7
4125
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:my-javascript-ext="my-ext1" extension-element-prefixes="my-javascript-ext"
0
1200
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 xerces. However, at runtime I get the following error when I try to do a transform: (Location of error unknown)org.xml.sax.SAXException: Can not resolve
3
1843
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 xerces downloaded and compiled), however, I'm getting quite a few compile errors. I downloaded and compiled xerces 2.6.0 and I downloaded xalan 1.9.0.
2
1514
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 id="green>55</entry> <entry id="blue">123</entry> so I could acces them with something like $returned. Problem is, I haven't figured out how to do that. I haven't found any
0
9432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7420
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.