You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Vijay S. Bajwa" <Vi...@Citigroup.com> on 2007/04/20 21:02:56 UTC

Element Distinguished Name

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? 

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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Element Distinguished Name

Posted by Alberto Massari <am...@datadirect.com>.
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: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org