• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in parsing xml using java

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai ppl,
i want to parse xml that looks like this...
<NameValuePair> <name>Connections/JMS/MQ/WMQEDIConnection/MIG_JNDIPROVIDERURL</name>
<value>lcgxs01:1417/CCTO.PMM</value>
<requiresConfiguration>true</requiresConfiguration>
</NameValuePair>
<NameValuePairPassword> <name>Connections/JMS/MQ/WMQEDIConnection/MIG_MQ_JNDI_PWD</name>
<value>#!sND0v4BYfh+uMPwcIX2l0A==</value>
<requiresConfiguration>true</requiresConfiguration>
</NameValuePairPassword>
to parse this i am using the java xml parsers.......
to parse the xml datas i have to specify the parental tag... to parse them like....

which can parse the xml data from the tag <NameValuePair>but it can't parse the xml data having xml tag </NameValuePairPassword>
but i need to parse them also.....
how can i do that....
kindly help me in solving it.....
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a shot in the dark, but if that is the complete XML document, then it is missing a root element. Or, rather, it has two root elements (NameValuePairPassword and NameValuePair), which makes it invalid XML, so I'm surprised it parses at all.
 
jothish chokkalingam
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Dittmer

i have just given the piece of the xml
i will give you the entire xml......

<?xml version="1.0" encoding="UTF-8"?>
<DeploymentDescriptors xmlns="http://www.tibco.com/xmlns/dd">
<name>RAMPService</name>
<version>1</version>
<owner>139697</owner>
<creationDate>12/4/06 5:12 PM</creationDate>
<isApplicationArchive>true</isApplicationArchive>
<DeploymentDescriptorFactory>
<name>{http://www.tibco.com/xmlns/repoinstance}RepoInstance</name>
<deploymentDescriptorFactoryClassName>com.tibco.dd.repo.RepoInstance</deploymentDescriptorFactoryClassName>
<deploymentDescriptorXsdFileName>com/tibco/dd/repo/RepoInstance.xsd</deploymentDescriptorXsdFileName>
</DeploymentDescriptorFactory>
<repoinstance:RepoInstance xmlns:repoinstance="http://www.tibco.com/xmlns/repoinstance">
<name>TIBCO BusinessWorks and Adapters Deployment Repository Instance</name>
</repoinstance:RepoInstance>
<DeploymentDescriptorFactory>
<name>{http://www.tibco.com/xmlns/dd}NameValuePairs</name>
<deploymentDescriptorFactoryClassName>com.tibco.archive.helpers.NameValuePairs</deploymentDescriptorFactoryClassName>
</DeploymentDescriptorFactory>
<NameValuePairs>
<name>FileAliases</name>
<NameValuePair>
<name>tibco.alias.rmi</name>
<value>bw-rmi-example</value>
<description/>
<requiresConfiguration>false</requiresConfiguration>
<disableConfigureAtDeployment>true</disableConfigureAtDeployment>
</NameValuePair>
</NameValuePairs>
<NameValuePairs>
<name>Global Variables</name>
<NameValuePair>
<name>Deployment</name>
<value>RAMP</value>
<requiresConfiguration>true</requiresConfiguration>
</NameValuePair>
<NameValuePair>
<name>DirLedger</name>
<value>.</value>
<requiresConfiguration>true</requiresConfiguration>
</NameValuePair>
<NameValuePair>
<name>RAMP/Orchestration/PollingInterval</name>
<value>5</value>
<requiresConfiguration>true</requiresConfiguration>
</NameValuePair>
<NameValuePairPassword>
<name>RAMP/ServiceEndPoints/ISSO</name>
<value>http://isso-services-it.merck.com/iamservice/services/ISSOCoreService</value>;
<requiresConfiguration>true</requiresConfiguration>
</NameValuePairPassword>
<NameValuePair>
<name>SharedConfigurations/JMS/EMSBWProcessProviderURL</name>
<value>tcp://uxwsdv65.merck.com:26804</value>;
<requiresConfiguration>true</requiresConfiguration>
</NameValuePair>
</NameValuePairs>
<DeploymentDescriptorFactory>
<name>{http://www.tibco.com/xmlns/dd}Modules</name>
<deploymentDescriptorFactoryClassName>com.tibco.archive.helpers.Modules</deploymentDescriptorFactoryClassName>
</DeploymentDescriptorFactory>
<Modules>
<name>Modules</name>
<pathName>Process Archive.par</pathName>
</Modules>
</DeploymentDescriptors>
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is your code that finds elements whose names are NameValuePair:Now, are you asking how to write code to find elements whose names are NameValuePairPassword? Or are you asking something else?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic