msxml

Forcing MSXML to format XML output with indents and newlines

南楼画角 提交于 2019-11-30 15:41:37
I am using MSXML 3.0 with Visual Basic 6 to store and retrieve configuration of my application. When saving the resulting DOMDocument to a XML file the root object gets rendered as a single very long line of text: <?xml version="1.0"?> <!--WORKAPP 2011 Configuration file--> <profile version="1.0"><frmPlan><left>300</left><top>300</top><width>24600</width><height>13575</height></frmPlan><preferences><text1/><text2/><text3/><background_color/><grid-major-step-x>50</grid-major-step-x><grid-major-step-y>50</grid-major-step-y></preferences></profile> Is it possible to force MSXML to format the

MSXML VBA: Validating XML against XSD: “The '' namespace provided differs from the schema's targetNamespace.”

浪子不回头ぞ 提交于 2019-11-30 15:12:41
问题 I’m trying to validate an .XML file against an .XSD file with MSXML 6.0 DOM but on executing the code I’m getting this error message: Test.xsd#/schema/targetNamespace[1] "The '' namespace provided differs from the schema's 'http://somewhere.com/root' targetNamespace." A heavily simplified versions of the .XML and .XSD files also produce the same error: XML FILE <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:noderoot xmlns:ns2="http://somewhere.com/root"> <general> <year>2011<

MSXML VBA: Validating XML against XSD: “The '' namespace provided differs from the schema's targetNamespace.”

走远了吗. 提交于 2019-11-30 14:16:11
I’m trying to validate an .XML file against an .XSD file with MSXML 6.0 DOM but on executing the code I’m getting this error message: Test.xsd#/schema/targetNamespace[1] "The '' namespace provided differs from the schema's 'http://somewhere.com/root' targetNamespace." A heavily simplified versions of the .XML and .XSD files also produce the same error: XML FILE <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns2:noderoot xmlns:ns2="http://somewhere.com/root"> <general> <year>2011</year> <month>02</month> </general> </ns2:noderoot> XSD FILE <?xml version="1.0" encoding="UTF-8"?> <xs

MSXML from C++ - pretty print / indent newly created documents

雨燕双飞 提交于 2019-11-30 09:52:59
I'm writing out XML files using the MSXML parser, with a wrapper I downloaded from here: http://www.codeproject.com/KB/XML/JW_CXml.aspx . Works great except that when I create a new document from code (so not load from file and modify), the result is all in one big line. I'd like elements to be indented nicely so that I can read it easily in a text editor. Googling shows many people with the same question - asked around 2001 or so. Replies usually say 'apply an XSL transformation' or 'add your own whitespace nodes'. Especially the last one makes me go %( so I'm hoping that in 2008 there's an

Which namespace is necessary to use SelectSingleNode() method (using default namespace and can't use the method)

此生再无相见时 提交于 2019-11-30 09:49:08
问题 Hi I have xml file (which is actually msbuild file) that uses different namespace <?xml version="1.0" ?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="'$(key)'=='1111'"> <Key>Value</Key> </PropertyGroup> </Project> But the problem is I can't use SelectSingleNode with that file because of xmlns="http://schemas.microsoft.com/developer/msbuild/2003" I believe it's since default namespace (necessary for the method) is gone

Looping through XML using VBA

和自甴很熟 提交于 2019-11-30 06:59:41
问题 I'm trying to loop through the following simple XML using VBA, with the ultimate goal to be able to easily extract the data in sequence. <?xml version="1.0"?> <PMRData> <Staff StaffName="Person 1"> <Openings>1.1</Openings> <Closures>1.11</Closures> </Staff> <Staff StaffName="Person 2"> <Openings>1.2</Openings> <Closures>1.22</Closures> </Staff> <Staff StaffName="Person 3"> <Openings>1.3</Openings> <Closures>1.33</Closures> </Staff> </PMRData> My code so far manages to get the data into the

build node-set variable from result tree fragment using <xsl:choose>

℡╲_俬逩灬. 提交于 2019-11-29 17:22:55
Is it possible to create a node-set variable from an rtf using xsl:choose (for use in MSXML engine)? I have the following construct: <xsl:choose> <xsl:when test="function-available('msxsl:node-set')"> <xsl:variable name="colorList" select="msxsl:node-set($std:colorList)"/> <xsl:for-each select="$colorList/color"> tr.testid<xsl:value-of select="@testid"/> { color:<xsl:value-of select="."/>; } </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:variable name="colorList" select="$std:colorList"/> <xsl:for-each select="$colorList/color"> tr.testid<xsl:value-of select="@testid"/> { color:<xsl:value-of

Which namespace is necessary to use SelectSingleNode() method (using default namespace and can't use the method)

穿精又带淫゛_ 提交于 2019-11-29 17:00:42
Hi I have xml file (which is actually msbuild file) that uses different namespace <?xml version="1.0" ?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="'$(key)'=='1111'"> <Key>Value</Key> </PropertyGroup> </Project> But the problem is I can't use SelectSingleNode with that file because of xmlns="http://schemas.microsoft.com/developer/msbuild/2003" I believe it's since default namespace (necessary for the method) is gone because of xmlns above. Then I think I just need to add necessary one for that.. But my tries weren't

Why does createProcessingInstruction in MSXML generate incomplete output?

好久不见. 提交于 2019-11-29 14:21:58
The following VBA code generates <?xml version="1.0"?> as output. Dim XML As New DomDocument Dim pi As IXMLDOMProcessingInstruction '.... some code that sets the root element of the document Set pi = XML.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'") XML.insertBefore pi, XML.documentElement Why is the encoding="UTF-8" left out? UTF-8 is the default encoding anyway. What you've specified is redundant, so the serializer likely omits it. The version field is not an optional field, though. If the file has an XML declaration at all, the declaration must include the version

Delphi/MSXML: XPath queries fail

独自空忆成欢 提交于 2019-11-29 07:56:13
I've loaded a XML document, and now I wish to run a XPath query to select a certain subset of the XML. The XML is <?xml version="1.0"?> <catalog xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> <genre>Computer</genre> <price>44.95</price> <publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description> </book> </catalog> and the procedure goes something like procedure RunXPathQuery(XML: IXMLDOMDocument2; Query: string); begin XML.setProperty(