XML-Command to create a '<IDOC BEGIN="1">' n

Rallnus
Member Posts: 79
I am searching for a command which generates a node like: '<IDOC BEGIN="1">'. There are always problems with blanks and special characters if you use "CurrNode.ownerDocument.createNode".
Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)
0
Answers
-
Rallnus wrote:<IDOC BEGIN="1">
The node is IDOC and BEGIN is an attribute, so their isn't any blank in your Nodename.
You must first create your node and then add the attribute. Be careful while using the setAttribute method of them DOM objects (Elements 'n Nodes). In my case the repeated call of this method caused the client and the NAS to crash. Instead I use this function (I work with Elements instead of nodes):Var Name DataType Subtype Length Ja rau_DomDoc Automation 'Microsoft XML, v4.0'.DOMDocument Ja rau_Element Automation 'Microsoft XML, v4.0'.IXMLDOMElement Nein vtx_AttributeName Text 250 Nein vtx_AttributeValue Text 250 CreateAttributeForElement(VAR rau_DomDoc : Automation "'Microsoft XML, v4.0'.DOMDocument";VAR rau_Element : Automation "'Microsoft XML, [...]) lau_Attribute := rau_DomDoc.createAttribute(vtx_AttributeName); IF ISCLEAR(lau_Attribute) THEN EXIT(FALSE); lau_Attribute.value(vtx_AttributeValue); rau_Element.setAttributeNode(lau_Attribute); CLEAR(lau_Attribute); IF FORMAT(rau_Element.getAttribute(vtx_AttributeName)) = vtx_AttributeValue THEN EXIT(TRUE) ELSE EXIT(FALSE);
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