Problem with XML Import

Rallnus
Member Posts: 79
At 1st: thanks for your examples, roman.
I solved several nodes beginning like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <ORDER>
-<ORDER_HEADER>
- <ORDER_INFO>
<ORDER_ID>4501136617</ORDER_ID>
with the code:
OpenXMLDocument(filename,XMLDocument);
LoadNodeList(XMLDocument,XMLNodeList,'ORDER/ORDER_HEADER/ORDER_ID');
LoadNode(XMLNodeList,XMLNode,0);
REPEAT
.....
But now I've a new file that starts like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <IDataXMLCoder version="1.0">
- <record javaclass="com.wm.data.BasicData">
<value name="fileName">c:\temp\pipeline_test.xml</value>
- <idatacodable name="iDocList" javaclass="com.wm.vrg.sap.idoc.BCDocumentList">
- <array name="iDocs" type="idatacodable" depth="1">
- <idatacodable javaclass="com.wm.pkg.sap.idoc.BCDocument">
What is the code to load nodes like these?
I tryied..
a) LoadNodeList(XMLDocument,XMLNodeList,'IDataXMLCoder version');
b) XMLNodeList := XMLDocument.getElementsByTagName('IDataXMLCoder version');
c) XMLNodeList:=XMLDocument.selectSingleNode('IDataXMLCoder version');
..but all without sucess.
The error message is "The call to Member selectSingleNode failed. msxml3.dll returned the following message "Expected Token eof found 'NAME'. IDataXMLCoder --> Version <--"
:?: Thx for Ur help.
I solved several nodes beginning like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <ORDER>
-<ORDER_HEADER>
- <ORDER_INFO>
<ORDER_ID>4501136617</ORDER_ID>
with the code:
OpenXMLDocument(filename,XMLDocument);
LoadNodeList(XMLDocument,XMLNodeList,'ORDER/ORDER_HEADER/ORDER_ID');
LoadNode(XMLNodeList,XMLNode,0);
REPEAT
.....
But now I've a new file that starts like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <IDataXMLCoder version="1.0">
- <record javaclass="com.wm.data.BasicData">
<value name="fileName">c:\temp\pipeline_test.xml</value>
- <idatacodable name="iDocList" javaclass="com.wm.vrg.sap.idoc.BCDocumentList">
- <array name="iDocs" type="idatacodable" depth="1">
- <idatacodable javaclass="com.wm.pkg.sap.idoc.BCDocument">
What is the code to load nodes like these?
I tryied..
a) LoadNodeList(XMLDocument,XMLNodeList,'IDataXMLCoder version');
b) XMLNodeList := XMLDocument.getElementsByTagName('IDataXMLCoder version');
c) XMLNodeList:=XMLDocument.selectSingleNode('IDataXMLCoder version');
..but all without sucess.
The error message is "The call to Member selectSingleNode failed. msxml3.dll returned the following message "Expected Token eof found 'NAME'. IDataXMLCoder --> Version <--"
:?: Thx for Ur help.
Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)
0
Answers
-
now I've solved the problem of reading the parent node. The way is not to mention the phrase after the first expression.
Example:
To find this node: <record javaclass="com.wm.data.BasicData"> you have to seach for <record>. The blank between "record" and "javaclass" will cause an error.
But what ist the way to get a special tag like <value name="BELNR">4500282151</value> ?
How can you specialize to get the tag "BELNR" ?Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions