Michael Picheca | 8 Dec 11:29
Picon
Picon
Favicon

help please

Hello,
 
I am trying to use your xml library (which I have found quite useful mind you) to access an xml file and from that xml file, find out what dtd it is using and validate it against that dtd (rather than having to hard code into my program what the dtd is).
 
So, for example my xml file looks like
 
<?xml version="1.0"?>
<!DOCTYPE tokens_test SYSTEM "tokens.dtd">
 
<tokens_test>
<token1>
<prop1 p="hello there4">prop1</prop1>
<prop2>prop2</prop2>
</token1>
</tokens_test>
 
and as you can see from the file, I want to validate against tokens.dtd.
 
Now, in my code I use
 
xmlDocPtr xml;
xmlNodePtr node;
xml = xmlParseFile(XMLFile)
node = xml->children;
 
and I notice that node->type is XML_DTD_NODE.
 
how can I get from this node position the value of tokens.dtd. I thought that it would be through node->properties but that value is set to NULL.
 
Thank you very much for your time and help.
 
Mike
 
--
Michael Picheca, pichecma <at> mcmaster.ca on 12/08/2001
Michael Picheca | 8 Dec 21:21
Picon
Picon
Favicon

help please

Now that I have subscribed and shut off HTML mail,  please consider 
my request.

Hello,

I am trying to use your xml library (which I have found quite useful 
mind you) to access an xml file and from that xml file, find 
out what dtd it is using and validate it against that dtd (rather 
than having to hard code into my program what the dtd is).

So, for example my xml file looks like

<?xml version="1.0"?>
<!DOCTYPE tokens_test SYSTEM "tokens.dtd">

<tokens_test>
<token1>
<prop1 p="hello there4">prop1</prop1>
<prop2>prop2</prop2>
</token1>
</tokens_test>

and as you can see from the file, I want to validate against 
tokens.dtd.

Now, in my code I use 

xmlDocPtr xml;
xmlNodePtr node;
xml = xmlParseFile(XMLFile)
node = xml->children;

and I notice that node->type is XML_DTD_NODE.

how can I get from this node position the value of tokens.dtd. I 
thought that it would be through node->properties but that 
value is set to NULL.

Thank you very much for your time and help.

Mike
--

-- 
Michael Picheca, pichecma <at> mcmaster.ca on 12/08/2001
Michael Picheca | 10 Dec 20:26
Picon
Picon
Favicon

xml help

I tried using the xmlDoValidityCheckingDefaultValue =1 that you suggested and 
I 
need to be able to halt the program after the validation with the dtd listed 
within the xml file fails. How do I do that? Is there a return value or 
something that I can use to invoke a halt? WHen I was using xmlValidateDtd it 
would return 0 if it failed and I would halt the program at this point.

Mike

--- Original Message ---
From: "Michael Picheca" <pichecma <at> mcmaster.ca>
To:  <veillard <at> redhat.com>
Cc:
Sent: Sat, 8 Dec 2001 14:34:12 -0800
Subject: Re: [xml] help please

>I added the line
>
>xmlDoValidityCheckingDefaultValue = 1;
>
>as you recommended but it says that it is an undeclared identifier.
>I
>also checked the documentation page and under the globals page it
>says that xmlDoValidityCheckingDefaultValue is both a define
>statement and a part of a structure. So, even at that, I dont
>understand how this line will be effective.
>
>Thanks for your time and help.
--

-- 
Michael Picheca, pichecma <at> mcmaster.ca on 12/10/2001

Gmane