Hi Vijay,

At 19.02 20/04/2007 +0000, Vijay S. Bajwa wrote:
I guess this is a DOM question. Given an XML or an XSD, how to give a
distinguisged name to an element. Consider the following XML. Imagine a cmd-
line application that is prints elements by-name, like
$ printVal -tname
$ Vijay

What if you wanted to print-by-name say, the MQ port of the second domain?
Maybbe: printVal -t 'config.domain[2].MQInfo.port'

Assuming such naming exists, can one just pass the DN (distinguished name) too
tje parser in the hope that it will understand it?

If you want to reuse a standard way of accessing XML elements, you should look at XPath; if you are using Xerces you should look at the Xalan-C project.

Alberto


Am I crazy?

<config>
  <name>Vijay</name>
  <MQInfo>
    <port>1514</port>
    <chl>mychan</chl>
  </MQInfo>
  <logDir>/home/foo/log</logDir>

  <domain>
    <logDir>/home/foo/domain1/log</logDir>
    <MQInfo>
      <port>1515</port>
      <chl>mychan1</chl>
    </MQInfo>
  </domain>

  <domain>
    <logDir>/home/foo/domain2/log</logDir>
    <MQInfo>
      <port>1516</port>
      <chl>mychan2</chl>
    </MQInfo>
  </domain>
</config>

Thanks,
Vijay



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to