Re: target namespace
From: Richard Blewett [DevelopMentor] (richardb_at_NOSPAMdevelop.com)
Date: 01/18/05
- Next message: Stephen W. Thomas: "RE: receive location name"
- Previous message: Ben: "Re: How to illustrate app integration design with biztalk?"
- In reply to: David: "Re: target namespace"
- Next in thread: David: "Re: target namespace"
- Reply: David: "Re: target namespace"
- Messages sorted by: [ date ] [ thread ]
To: microsoft.public.biztalk.general Date: Tue, 18 Jan 2005 15:07:23 -0800
Can you provide a document as well as the code so I can test this and find a solution?
Regards
Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Thank you for bringing this up. We have come as far as you describe, but get
nothing at SelectSingleNode (code provided below).
1) We fail to extract the prefix.
(It could be "ns0", "ns1" or something else set by Biztalk.)
Other discussions outside technet assume you know the prefix, but since this
is set by Biztalk, any common parser would have to read it.
2) We fail to select a node with a namespace even if providing prefix.
( Probably not an option, but how did you remove the namespaces from the
XML? )
Does this relate to the following bug? The workaround also fails.
http://support.microsoft.com/default.aspx?scid=kb;en-us;324996
Regards,
David
Function GetXMLData(ByRef xmlDoc As Xml.XmlDocument, ByVal strXPath As
String, ByVal strTag As String) As String
Dim strReturn As String
Dim nsmgr As XmlNamespaceManager = New
XmlNamespaceManager(xmlDoc.NameTable)
Dim objXmlNode As XmlNode
Dim strPrefix As String
Dim strUri As String
Try
strPrefix = xmlDoc.Prefix ' ""
strUri = xmlDoc.DocumentElement.NamespaceURI() ' will return
actual URI
'nsmgr.AddNamespace(strPrefix, strUri)
nsmgr.AddNamespace("ns0", strUri)
'objXmlNode = xmlDoc.SelectSingleNode(strXPath & strTag, nsmgr)
'Nothing
'objXmlNode = xmlDoc.SelectSingleNode("TransactionId") 'Nothing
'objXmlNode = xmlDoc.SelectSingleNode("ns0:TransactionId",
nsmgr) 'Nothing
objXmlNode = xmlDoc.SelectSingleNode("TransactionId", nsmgr)
'Nothing
If objXmlNode Is Nothing Then
Throw New Exception("")
Else
strReturn = objXmlNode.InnerText.ToString
End If
Return strReturn
Catch ex As Exception
Throw New Exception("")
End Try
End Function
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 17/01/2005
[microsoft.public.biztalk.general]
- Next message: Stephen W. Thomas: "RE: receive location name"
- Previous message: Ben: "Re: How to illustrate app integration design with biztalk?"
- In reply to: David: "Re: target namespace"
- Next in thread: David: "Re: target namespace"
- Reply: David: "Re: target namespace"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|