How can we skip or delete doctype while transforming one xml into another xml

How can we skip or delete doctype while transforming one xml into another xml

the problem is while i loading xml with vba program that cant able to read xml sheet due to DTD. if i am disable dtd it is working fine. can you help me to understand what changes are required for vba to ignore DTD?

my xml sheet start like <?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE Pip3B12ShippingOrderRequest SYSTEM "3B12_MS_V01_02_ShippingOrderRequest.dtd" PUBLIC "SYSTEM">

My vba program to call source xml and xslt given below, Sub dummy() Call Transform("C:\Users\nypaul\Desktop\XMLTESTING\SOURCE\01_open_file_20180606_093719_1135.xml", "C:\Users\nypaul\Desktop\XMLTESTING\abc.xsl", "C:\Users\nypaul\Desktop\testing\out\01_open_file_180428_045209_10213.xml")

MsgBox "ok"

End Sub

Function Transform(sourceFile, styleSheetFile, resultFile) As Boolean

Dim Source As Object Dim StyleSheet As Object Dim Result As Object

Set Source = CreateObject("MSXML2.DOMDocument") Set StyleSheet = CreateObject("MSXML2.DOMDocument") Set Result = CreateObject("MSXML2.DOMDocument")

On Error GoTo TheEnd

Transform = True

' Load data. Source.async = False Source.Load sourceFile

' Load style sheet. StyleSheet.async = False StyleSheet.Load styleSheetFile

' Do the transformation Source.transformNodeToObject StyleSheet, Result Result.Save resultFile

' Transformation done, exit normally Exit Function TheEnd: ' If an error occured, return False Transform = False

End Function XSLT FORMAT LIKE <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <ENVELOPE >
nyfin paulAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Have you tried setting the following, not sure if this might get around the problem you are having or not...

Source.validateOnParse = False


ยปbp
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.