473,465 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem with xslt file

HI all,

I have a program which extracts elements from xml file and puts in
different xml file in different format , this is done by java program
using xsl file.

my i/p xml is like:
<NewData xmlns:--------namespace declaration
>
<element1></element1>
<mynamespace:element2 obs="1234"/>
---
--

</NewData>
Now, in my xsl file what i did, is first declared namespace same as in
i/p xml file.
then
i wrote the xpath expression like: NewData/mynamespace:element1

but i am not able to extract data from element1

what is the problem? is it right way of doing?

Pleas help me.

Pathik

Mar 23 '07 #1
1 1317
On Mar 23, 9:01 am, "Pathik" <gandhi.pat...@gmail.com>
wrote:
my i/p xml is like:
<NewData xmlns:--------namespace declaration

<element1></element1>
<mynamespace:element2 obs="1234"/>
---
--

</NewData>
Posting examples like that is a very bad idea, since people
trying to help you are left wondering what you really
meant, what are geniune problems with your code/documents
and what are merely typos/thinkos introduced when hastily
typing that not-even-pseudocode.

General advice is always trying to post what is commonly
called 'minimum complete example' demonstrating your
problem, and using copy-paste to do it as well to avoid
introducing extra bugs.
Now, in my xsl file what i did, is first declared
namespace same as in i/p xml file. then i wrote the xpath
expression like: NewData/mynamespace:element1

but i am not able to extract data from element1
Well, since you didn't post any real example, it's hard to
tell what your problem really is, but element1 does not
seem to be in the mynamespace namespace, now does it?
element2 is, but you do not refer to it in your XPath.
what is the problem? is it right way of doing?
The right way of doing what?

--
Pavel Lepin

Mar 23 '07 #2

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

Similar topics

2
by: Doug Farrell | last post by:
Hi all, I'm trying to build a demonstration website using mod_python and 4Suite to show how we could transform XML documents into HTML with XSLT. Here is a piece of code that causes it to blow...
0
by: Mark Constant | last post by:
I was doing a test website where on one page somebody could select a Genre from a drop-down list and it would display every sub-listing under that specific Genre. If the user selected All it would...
2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
4
by: Trygve | last post by:
I'm trying to convert a XML-document using XSLT. Depending on the source file (the XML-document) the conversion is either correct or incorrect. If the first tag in the document contains an non...
4
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my...
2
by: chris | last post by:
Hi there, I create an XML file from a dataset like this: System.IO.StreamWriter xmlSW = new System.IO.StreamWriter(FILENAME); dsUserData1.WriteXml(xmlSW, XmlWriteMode.WriteSchema);...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
2
by: Reshma Prabhu | last post by:
hello, I am trying to do an xsl tranformation from an XML file into another xml file. I want the output file to be in MemoryStream so that my dataset can direclty read xml using...
0
by: Omatase | last post by:
I have an xslt file I need to open at runtime. Here is my configuration: main assembly (dll) |-----xslt file unit test assembly I have a reference to my main assembly in my unit test...
1
by: Sandeep Singh | last post by:
Hi, How to do group by in XSLT ? I tried on the following codes: <files> <file name="swablr.eps" size="4313" project="mars"/> <file name="batboy.wks" size="424" ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.