473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

ISAXXMLReader PutFeature

Hello,

MSXML Version used : MSXML3.0
Language used: VC6.0
Platform: Windows 2000

Am trying to parse a DTD file to create a tree like hierarchical structure
based on certain business rules.

For this we are using ISAXXMLReader . The problem is that when I try to set
the property http://xml.org/sax/properties/lexical-handler , it is
unsuccessful. Also I am using the parseURL method to directly parse the .dtd
file so the call is pRdr->parseURL(L"SAX2Print.dtd"); In all the examples
I have seen the method being used with Xml files and DTD files get parsed
when a !DOCTYPE processing instruction is encountered. I am not sure is this
could be creating a problem

Ultimately I want to be able to get the ElementDecl, AttributeDecl.. etc:
events from the SAXReader. Currently a,m unable to generate these events,.
Following is the subset of the code, that sets the properties and initiates
the parse
MyContent * pMc = new MyContent();
hr = pRdr->putContentHandler(pMc);
VARIANT_BOOL boolvalue = -1;

hr =
pRdr->putFeature(L"http://xml.org/sax/features/external-general-entities",bo
olvalue);
hr =
pRdr->putFeature(L"http://xml.org/sax/features/external-parameter-entities",
boolvalue);

SAXLexicalHandler * lh = new SAXLexicalHandler();

hr=
pRdr->putProperty(L"http://xml.org/sax/properties/lexical-handler",_variant_
t(new SAXLexicalHandler()));

SAXDeclHandlerImpl * dh = new SAXDeclHandlerImpl();
hr=
pRdr->putProperty(L"http://xml.org/sax/properties/declaration-handler",_vari
ant_t(new SAXDeclHandlerImpl()));

pRdr->parseURL(L"SAX2Print.dtd");

Thanks,
Maansi

vv
Nov 11 '05 #1
1 2268
Maansi Gupta wrote:
For this we are using ISAXXMLReader . The problem is that when I try to set
the property http://xml.org/sax/properties/lexical-handler , it is
unsuccessful. What means "unsuccessful" exactly? Any error or just doesn't work as you think
it should?
Also I am using the parseURL method to directly parse the .dtd
file so the call is pRdr->parseURL(L"SAX2Print.dtd"); I don't think it's good idea to parse DTD.
Ultimately I want to be able to get the ElementDecl, AttributeDecl.. etc:
events from the SAXReader. Currently a,m unable to generate these events,.

Use ISAXDeclHandler.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mikko Ohtamaa | last post by:
Hi, I am quite new to Python, PythonCom and COM generally. As a former Java programmer, I have found Python's flexible ability to access native Win32, especially COM, very comfortable. However,...
9
by: Developer | last post by:
Hello, I have an xml retrieved by a client running Japanese windows from a server running Japanese windows. I can view this document in IE.6. (The Opera browser, though, reports the error.) ...
4
by: Developer | last post by:
CoInitialize(NULL); ISAXXMLReaderPtr pReader = NULL; CHR(pReader.CreateInstance(__uuidof(SAXXMLReader))); A1ContentHandler * pA1ContentHandler = A1ContentHandler::CreateInstance();...
3
by: Developer | last post by:
Hello, I see that ISAXXMLReader has a putProperty() method, and one of the properties is "schemas". How do you use it? Does this mean the xml is validated as it is parsed by the SAX reader? ...
8
by: FS Liu | last post by:
Hi, I am writing ATL Service application (XML Web service) in VS.NET C++. Are there any sample programs that accept XML as input and XML as output in the web service? Thank you very much.
6
by: FS Liu | last post by:
Hi, In my current ATL server project, I have to parse the input in the client application's request to find out the different combination of parameters, instead of using SOAP. For this reason,...
0
by: Leonid | last post by:
Hello, Please help me to resolve next problem: I have Web service installed on the network and I can communicate with it via WSDL file from several applications including VC++6 application...
2
by: Michael Bachar | last post by:
Hi, I'm trying to access a Web Service using C++ in Visual Stodio.NET. I follow the Walkthrough in Microsoft MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html...
0
by: Aslane | last post by:
I have followed the Sax2 JumpStart example (http://msdn2.microsoft.com/en-us/library/ms994335.aspx), to implement a xml Parser in my project. The projects uses DirectX to create a device and use it,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.