problem with xslt file

P

Pathik

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
 
P

p.lepin

my i/p xml is like:
<NewData xmlns:--------namespace declaration

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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top