problem with xslt file

Discussion in 'XML' started by Pathik, Mar 23, 2007.

  1. Pathik

    Pathik Guest

    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
     
    Pathik, Mar 23, 2007
    #1
    1. Advertising

  2. Pathik

    Guest

    On Mar 23, 9:01 am, "Pathik" <>
    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, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    687
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,691
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    625
    Laurens
    Jan 26, 2004
  4. Replies:
    2
    Views:
    724
    Henry S. Thompson
    Oct 19, 2005
  5. Replies:
    4
    Views:
    683
Loading...

Share This Page