By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,222 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,222 IT Pros & Developers. It's quick & easy.

apply in-memory .xsd schema to updategram

P: n/a
Below I'm generating an updategram via xslt and currently referencing
schema via
<updg:sync mapping-schema="hpXSD.xsd">
....
</updg:sync>

But I would like to LOAD the .xsd schema into memory and APPLY to the
updategram in memory. Tried using XmlValidatingReader but couldn't
get it to work. Thanks

Dim xmlPath As String = "xml/hpXML.xml"
Dim xsltPath As String = "xml/hpXSLT.xslt"
Dim xsdPath As String = "xml/hpXSD.xsd"

'(1) XML object
Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.Load(xmlPath)
Dim root As XmlElement = xmlDoc.DocumentElement

'(2) XSLT object
Dim xslt As XslTransform = New XslTransform
xslt.Load(xsltPath)

'(3) UPDATEGRAM object
Dim myStringWriter As StringWriter = New StringWriter
xslt.Transform(root.CreateNavigator(), Nothing, myStringWriter,
Nothing)

'(4) SCHEMA object
?????
Dim xmlSchema As XmlDocument
xmlSchema.Load(xsdPath)
'execute updategram
Dim dbComm As New SqlXmlCommand(g_connString)
dbComm.CommandType = SqlXmlCommandType.UpdateGram
dbComm.CommandText = myStringWriter.ToString
dbComm.ExecuteNonQuery()
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.