simple question about MSXML



  • 1. WordML and symbol font
    Hi; When writing using the symbol font in a WordML file it saves as: <w:r> <w:rPr> <w:rFonts w:ascii="Symbol" w:h-ansi="Symbol"/> <wx:font wx:val="Symbol"/> <wx:sym wx:font="Symbol" wx:char="F073"/> </w:rPr> <w:t>/w:>> < note: the actual character is in the<..< node. But when the same file is saved in rtf format, it is saved as: \f3\insrsid10572502 \'73 In other words 0xF073 becomes 0x73. So, what is the rule for this - when do I remove the 0xF000 from the font when converting it? It seems to hold for Symbol and Wingdings - but not for Arial & Times New Roman. thanks - dave -- thanks - dave
  • 2. Loading Outlook Express Contacts' Details into an XML file
    BlankHi all, I am building a small app to load contacts' details from O.Express. But due to the large amount of contacts in the Windows Address Book (>1000) it is taking a lot of time to load up hence I was thinking about loading the contacts' details (name,address,email,mobile telephone number etc) into an XML file, as I think that it will load up faster in the XML than in the object that I am using at the moment (for the curious kind, I am developing the app in Delphi6 and the object I am using at the moment is a TStringList). I dont have much knowledge about XML so I have turned up here to ask if anyone can help me out or point me in the right direction as if and how I can load the details into an XML document which I can then use to load up into my app. TIA, Mounil.

simple question about MSXML

Postby emVuZ2t1bg » Fri, 14 May 2004 13:36:03 GMT

I want to use MSXML to create a XML file like this
<?xml version="1.0" encoding="UTF-8"?><Schema xmlns=" http://www.**--****.com/ "><element name="Features" type="wfs:featuresType"  substitutionGroup="gml:_FeatureCollection"/></Schema

Here is my source coede
#include <stdio.h
#import <msxml4.dll
using namespace MSXML2
int main(int argc, char* argv[]

    IXMLDOMDocument2Ptr pXMLDom
    HRESULT hr
    hr = pXMLDom.CreateInstance(__uuidof(DOMDocument40))
    if (FAILED(hr))
        printf("Failed to CreateInstance on an XML DOM")
        return NULL
    pXMLDom->preserveWhiteSpace = VARIANT_TRUE
    IXMLDOMProcessingInstructionPtr pi
    pi = pXMLDom->createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
    if (pi != NULL)
    IXMLDOMElementPtr pe
    IXMLDOMNodePtr nodePtr
    _variant_t varTyp((short)NODE_ELEMENT)
    nodePtr=pXMLDom->createNode(varTyp,"Schema"," http://www.**--****.com/ ")
    pe = pXMLDom->documentElement
    IXMLDOMAttributePtr pa
    IXMLDOMDocumentFragmentPtr pdf
    pdf = pXMLDom->createDocumentFragment()
    pe = pXMLDom->createElement("element")
    hr = pXMLDom->save("dynaDom.xml")
    if (FAILED(hr))
        printf("Failed to save DOM to dynaDom.xml\n")
        printf("DOM saved to dynamDom.xml\n")
    if (pXMLDom) pXMLDom.Release()
    return 0

But the output is
<?xml version="1.0" encoding="UTF-8"?><Schema xmlns=" http://www.**--****.com/ "><element xmlns="" name="Features" type="wfs:featuresType" substitutionGroup="gml:_FeatureCollection"/></Schema

you can see that :there is an attribute "xmlns" within the "element" tag and the value of the attribute is nothing
I don't want the out come is this,Please Help!

Re: simple question about MSXML

Postby Alex Shirshov » Fri, 14 May 2004 18:41:27 GMT

Hello, zengkun!
You wrote  on Wed, 12 May 2004 21:36:03 -0700:

[Sorry, skipped]

 z> But the output is: <?xml version="1.0" encoding="UTF-8"?><Schema
 z> xmlns=" http://www.**--****.com/ "><element xmlns=""
 z> name="Features" type="wfs:featuresType"
 z> substitutionGroup="gml:_FeatureCollection"/></Schema>
 z> you can see that :there is an attribute "xmlns" within the "element" tag
 z> and the value of the attribute is nothing. I don't want the out come is
 z> this,Please Help!

Since "element" element belongs to  http://www.**--****.com/ 
namespace you should use createNode function us you do with "Schema"

With best regards, Alex Shirshov.

Re: simple question about MSXML

Postby emVuZ2t1bg » Sat, 15 May 2004 11:26:02 GMT

Because "Schema" is the root element in this XML file,so I want the namespace " http://www.**--****.com/ " to be the default namespace.And "element" element use the same namespace as it's father "Schema".

Re: simple question about MSXML

Postby Alex Shirshov » Sat, 15 May 2004 14:56:50 GMT

Hello, zengkun!
You wrote  on Thu, 13 May 2004 19:26:02 -0700:

 z> Because "Schema" is the root element in this XML file,so I want the
 z> namespace " http://www.**--****.com/ " to be the default
 z> namespace.And "element" element use the same namespace as it's father
 z> "Schema".

That exactly how will looks document after my suggestion.
Did you try it?

With best regards, Alex Shirshov.

Re: simple question about MSXML

Postby emVuZ2t1bg » Sat, 15 May 2004 20:31:05 GMT

Thank you for your help
It has been settled.

Similar Threads:

1.Simple Question about MSXML 6 (and SDK)

will installing this, also install all the previous versions of MSXML ?
 (like 5.0, 4.0)

I've already got machines with v4 and v5 on them, so I can't test.

I have an app that utilizes the ProgID's from v4 and also the
functions, like contains(), etc, none of which are available in v3.

I need to know if I have to change all my ProgID's to v6 or not.

2.Simple Question - Simple Answer?


Maybe you know howto. I want to have an element which takes a
subelement. Depending on an attribute within this subelement, a second
subelement may have different attributes allowed:

001    <Service>
002        <Header Kind="1"/>
003        <Input Data="asdasd"/>
004    </Service>
005    <Service>
006        <Header Kind="2"/>
007        <Input User="me" App="main"/>
008    </Service>
How can I specify that in an XML Schema? I tried the following:

001    <xsd:complexType name="service">
002        <xsd:choice minOccurs="1" maxOccurs="1">
003            <xsd:element name="Service" type="kind1"/>
004            <xsd:element name="Service" type="kind2"/>
005        </xsd:choice>
006    </xsd:complexType>
008    <xsd:complexType name="kind1">
009        <xsd:sequence>
010            <xsd:element name="Header" type="header1"/>
011            <xsd:element name="Input" type="input1"/>
012        </xsd:sequence>
013    </xsd:complexType>
015    <xsd:complexType name="kind2">
016        <xsd:sequence>
017            <xsd:element name="Header" type="header2"/>
018            <xsd:element name="Input" type="input2"/>
019        </xsd:sequence>
020    </xsd:complexType>
022    <xsd:complexType name="header1">
023        <xsd:attribute name="Kind" use="required" 
024    </xsd:complexType>
026    <xsd:simpleType name="header1Att">
027        <xsd:restriction base="xsd:string">
028            <xsd:pattern value="1"/>
029        </xsd:restriction>
020    </xsd:simpleType>
032    <xsd:complexType name="input1">
033        <xsd:attribute name="Data" use="required" 
034    </xsd:complexType>
036    <xsd:complexType name="header2">
037        <xsd:attribute name="Kind" use="required" 
038    </xsd:complexType>
030    <xsd:simpleType name="header2Att">
041        <xsd:restriction base="xsd:string">
042            <xsd:pattern value="2"/>
043        </xsd:restriction>
044    </xsd:simpleType>
046    <xsd:complexType name="input2">
047        <xsd:attribute name="User" use="required" 
048        <xsd:attribute name="App" use="required" 
049    </xsd:complexType> 
However, doublicate definitions of an element of the same name seem
not to be allowed, which makes sense. But I don't know how to define
this sort of structur e then. Any ideas?

Thanks in advance
Daniel Frey

3.Pretty simple XML fetching question


I am trying to do the following with BTS 2002:

1. Pull an XML file down from an IIS machine running SQLXML and exposing the
2. Use the BTS adapter for FTP to send that file to a trading partner.

I think I can do #2, piece of cake. For some reason, I can't get my head
around performing step #1. I looked into Receive Functions, but it looks
like the HTTP transport is only usable for documents being POSTed to
BizTalk. I need to GET the XML file via HTTP from a remote web server. I
imagine this must be built into BTS 2002, I just can't find where I would do
this. I hope it's not in Orchestration, because I haven't played with that
much yet.

If it's not built in, what would you recommend I do? I am mainly a C# and
SQL Server programmer, so I could easily make something to pull down the XML
with a batch command line app, but I really want to stick to the native
functions of BTS as much as possible.

Thanks in advance for your advice,


4.2 simple questions about ado/xml


1. what is the quickest/most efficient way to get read-only records from an
access table into an xml string?  i have the following which works fine. is
this the most efficient way?

OleDbDataAdapter da = new OleDbDataAdapter(cmd);

DataSet ds = new DataSet("Records");

da.Fill (ds, "Record");

return ds.GetXml();

2. after i add/update/delete access record(s) i want the information of the
record(s) in xml. how can i do this?

thanks a lot.  :)

5.XML XPath and Simple Stringwriter or Streamwriter Question in Datagrid

Hi, please consider this snippet:

string filename "c:\\inetpub\\wwwroot\\getdirections\\Directions.xml";
XmlDocument doc = new XmlDocument();
XmlNodeList authorList =
StreamWriter writer = new StreamWriter();
foreach( XmlNode authorNode in authorList )
	writer.Write( authorNode.OuterXml );


DataSet ds = new DataSet();
ds.ReadXml( writer.ToString() );
CustomerDataGrid.DataSource = ds.Tables["locations"];

If I use Reponse.Write, this work (not using the datagrid of course).
What I am trying to do is capture that data in the foreach into some
kind of stream or *something* so I can bind it to my dataset.  The
query works, the data will return.  I just cannot find out how to
assign it to the dataset from a stream.

Thank you for any help.

6. Simple question about ReadXml and WriteXml

7. Simple XML parsing question

8. Simple XML parsing question..

Return to xml


Who is online

Users browsing this forum: No registered users and 13 guest