[xml] Newbie default value problem
- From: Thomas Burgess <thomas burgess physto se>
- To: xml gnome org
- Subject: [xml] Newbie default value problem
- Date: Tue, 28 Jan 2003 15:07:59 +0100 (CET)
Hi list,
I'm having some problems with getting the default values for my
attributes, can you do such a thing? how?
I want to parse an xmlfile with containing a line like this
<INPUT infile="infile.txt"/>
so I have defined input in a DTD like this
<!ELEMENT input EMPTY>
<!ATTLIST input infile CDATA "dummy">
then I can get the property by
myinfile = xmlGetProp(cur,"infile")
but when the user doesn't supply infile
<INPUT/>
it doesn't work, so I check for it first
if(xmlHasProp(cur,property)){
myinfile=xmlGetProp(cur,"infile")
} else {
myinfile=???
}
my problem is to get "dummy" from the dtd and I couldn't find any way to
do this in the api docs.
/thomas burgess
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]