name="urn:schemas-microsoft-com:office:infopath:CurrentSPInfo:-dataFormSolution"
"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:ODbYM%23XVFHA.2572@TK2MSFTNGP14.phx.gbl...
>
>
> Rick wrote:
>
>> I have an XML document that is generated from Infopath, I need to change
>> the value of a namespace that is defined in a node in the form:
>> <xsf:xDocumentClass "xmlns:my=valuehere">.
>> when i navigate to the namespace value it is read only and cannot be
>> changed. Can anyone tell me how to change this value?
>>
>> My Code:
>>
>> Dim sSingleNode As XmlNode = objDoc.SelectSingleNode("//xsf:Node",
>> NamespaceManager)
>> Dim nav As XPathNavigator
>> Dim docNav As XPathDocument
>> docNav = New XPathDocument(sFile)
>> nav = docNav.CreateNavigator
>> nav.MoveToRoot()
>> nav.MoveToFirstChild()
>> nav.MoveToNext()
>> nav.MoveToFirstNamespace()
>> Do
>> If nav.Name.ToUpper = "MY" Then
>> nav.Value = Value 'Change value here
>> End If
>> Loop While nav.MoveToNextNamespace
>
> XPathDocument is always read-only, whether you want to change a namespace
> or something else, it is not possible with an XPathDocument.
> Even with an XmlDocument it is not possible to simply change a namespace
> URI associated with an element or attribute node as the namespace is
> determined during creation of the node thus you have to create new
> elements or attributes in the proper namespace.
> An XSLT stylesheet is often helpful to transform an XML document to
> another XML format changing stuff like namespaces as needed.
> If you show us some example input and desired output then we can show you
> how to transform that with XSLT.
>
>
> --
>
> Martin Honnen --- MVP XML
>
http://JavaScript.FAQTs.com/