c - DTD validation error with libxml2 -
i try validate xml data dtd. have use libxml2. produced xml data looks this:
<?xml version="1.0"?> <root> <vent id="1"> <usb_device_id>1</usb_device_id> <usb_device_channel>2</usb_device_channel> <vent_box_id>3</vent_box_id> <vent_box_channel>4</vent_box_channel> </vent> </root>
my dtd looks this:
<!element root (vent) > <!element vent (usb_device_id, usb_channel, vent_box_id, vent_box_channel) > <!attlist vent id (id) #required > <!element usb_device_id (cdata) > <!element usb_channel (cdata) > <!element vent_box_id (cdata) >
i use http://xmlsoft.org/html/libxml-valid.html#xmlvalidatedtd on parsed tree. setup error message:
element vent: validity error : value "1" attribute id of vent not among enumerated set
where wrong? in advance...
your attribute id
defined having type id
. means has valid xml name , first character must not digit letter. description can found here or better in w3c documentation itself: id , names (copied form bluepixy's comment)
Comments
Post a Comment