You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by pr...@wipro.com on 2005/04/19 07:08:08 UTC

How to get an Xpath?

I have compiled the Xalan 1.9  C++  in Sol 2.8.
Samples are aslo compiled and I am able to run the EXE's.

Imagine I have an XML file as follows

<PML>
    <EC>
            <TN>100-111-99<!-- UPDATE FROM "100-112-0039" --></TN>
            <LVL1><!-- DELETE LVL1 -->
                <AS>aaa</AS>
            </LVL1>
            <LV1>
                <NU>AB/10<!-- UPDATE FROM "AB/11" --></NU>
            </LV1>
            <LV1><!-- DELETE LV1 -->
                <EMP>101</EMP>
                <DT>10012005</DT>
            </LV1>
    </EC>
</PML>

If I give an input as "UPDATE FROM" the output I should get is
"PML:EC.TN" and  "PML:EC.LV1"
Similarly if I give an input as "DELETE" I should get the output as
"PML:EC.LVL1" and "PML:EC.LV1[2]"

Is there a way to get this from the Xalan API's ?
If you have any sample program please do send me...

I checked the sample program present in Xalan , it takes three
parameters "XML file" , "Context" and "XPATH" .

I am not able to understand what should go as input in case of  "context
" and "XPATH".


Thanks
-Praveen




Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

Re: How to get an Xpath?

Posted by Amit Dang <am...@intersolutions.stpn.soft.net>.
Hi Praveen,
    You need to provide the XML data/stream, it can be via XML File or in memory. A sample has been provided with Xalan for XML data via file and for XML data stored in a memory you can use 'MemBufInputSource'. I am enclosing a .cxx and .hxx file while might be of some help to you.
Hope this helps.

Cheers,
Amit Dang
  ----- Original Message ----- 
  From: praveen.maruvekere@wipro.com 
  To: xalan-c-users@xml.apache.org 
  Sent: Tuesday, April 19, 2005 10:38 AM
  Subject: How to get an Xpath?


  I have compiled the Xalan 1.9  C++  in Sol 2.8.
  Samples are aslo compiled and I am able to run the EXE's.

  Imagine I have an XML file as follows

  <PML>
      <EC>
              <TN>100-111-99<!-- UPDATE FROM "100-112-0039" --></TN>
              <LVL1><!-- DELETE LVL1 -->
                  <AS>aaa</AS>
              </LVL1>
              <LV1>
                  <NU>AB/10<!-- UPDATE FROM "AB/11" --></NU>
              </LV1>
              <LV1><!-- DELETE LV1 -->
                  <EMP>101</EMP>
                  <DT>10012005</DT>
              </LV1>
      </EC>
  </PML>

  If I give an input as "UPDATE FROM" the output I should get is "PML:EC.TN" and  "PML:EC.LV1"
  Similarly if I give an input as "DELETE" I should get the output as "PML:EC.LVL1" and "PML:EC.LV1[2]"

  Is there a way to get this from the Xalan API's ?
  If you have any sample program please do send me...

  I checked the sample program present in Xalan , it takes three parameters "XML file" , "Context" and "XPATH" .

  I am not able to understand what should go as input in case of  "context " and "XPATH".


  Thanks
  -Praveen


        Confidentiality Notice 

        The information contained in this electronic message and any attachments to this message are intended
        for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
        you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
        and destroy all copies of this message and any attachments.