Add DocumentType node in XML

savvas7savvas7 Member Posts: 1
I am creating an xml but I have to add also a specific Document Type.

I am using dotnet variables to open xml but I am doing something wrong.

My Code is

XMLDOMDocument := XMLDOMDocument.XmlDocument;
XMLDOMDocument.Load(TempInstream);
XMLDocType := XMLDOMDocument.CreateDocumentType('DDT','http://localhost:8001/sad.dtd,'','');
XMLDOMDocument.AppendChild(XMLDocType);
XMLDOMDocument.AppendChild(XMLDOMDocument.CreateElement('DDT'));
XMLDOMDocument.Save('C:\xmlfilewithDocType.xml');

Variables:
XMLDOMDocument DotNet System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
TempInstream InStream
XMLDocType DotNet System.Xml.XmlDocumentType.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Can anyone help me with this?

Thank you in admvance,

Savvas

Answers

  • devdronedevdrone Member Posts: 14
    No sure why are you creating a XML in c/al when you can get the required XML using XMLPorts or Page Services.
Sign In or Register to comment.