Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML Parsing Multiple tags

126 views
Skip to first unread message

Viorel Neculae

unread,
Feb 1, 2012, 11:58:16 AM2/1/12
to
Hello, i hope I'm not making a re post. But i have an issue.
I am using TDI 6.1.1 to parse an XML file with multiple tags. However
i found out that using the parser configuration from the XML parser in
TDI he is not able to read (or make him read) the ones i am interested
to read, and he remains stuck to the first two tags
I understood that using some scripts in the Hook tab might help me in
this situation, but i have no experience in Java Coding
Is there an easier way to go around this issue, does someone has any
directions that can point me to regarding the scripts.

The XML looks like this, and I'm interested in parsing what's under
<infrastrukturRecord>.

<?xml version="1.0" encoding="UTF-8"?>
<Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MessageHeader>
<Sender>ITAM</Sender>
</MessageHeader>
<InfrastrukturBody>
<infrastrukturRecord>
<TECHNISCHE_ID></TECHNISCHE_ID>
<HOST_ALIAS>v037za</HOST_ALIAS>
<PLATTFORM>Test</PLATTFORM>
<OS></OS>
<OS_VERSION></OS_VERSION>
<SAP_NR></SAP_NR>
<STANDORT></STANDORT>
<RAUM></RAUM>

alchemisx yep

unread,
Feb 3, 2012, 9:55:08 AM2/3/12
to
I'm guessing you probably have default XML parsing enabled and not
XMLSax parsing.

Default XML Parsing in TDI performs a two level search by default. So
if you set your starting point at <infrastrukturRecord>, you should
only be returned <TECHNISCHE_ID> and <HOST_ALIAS>.

Now, you can customize this to go over n levels and Lak Sri does a
wonder job of explaining this and the differences XML DOM (or just XML
as you see it in TDI) and XMLSax parsing.

Basically, it follows that XMLSax pulls everything under a certain
entry point so if you set XMLSax as your parser and
infrastrukturRecord as your entry point, you'll have access to each
sub key/value of infrastrukturRecord. XML DOM on the other hand is
more or less cherry picking what you want while iterating over each
key/value.

I'd reference Lak Sri's power point in this regard for more
information.

www.tdi-users.org/twiki/pub/Integrator/HowTo/TDI_WS_FULL.ppt

Hope this helps,

-rsxdc5

Viorel Neculae

unread,
Feb 6, 2012, 4:27:15 AM2/6/12
to
Hello,

Thank you for the reply, Indeed, i have tried the default XML parsing
and not the XMLSax method. I will take a look at the ppt, to see what
can i do.
Many thanks again

Viorel Neculae

unread,
Feb 6, 2012, 7:49:20 AM2/6/12
to
Hi, just tested the method following the .ppt document and it worked.
Thank you again for the help
0 new messages