开发者

Perl XML parser to extract the default values of the optional attributes fromt the xsd file

I need to parse an XML file through a perl script. While parsing the file, 开发者_如何学JAVAI need to validate it with the corresponding xsd(schema definition) file. The xsd file contains some optional attribute with a default value being provided. I have to parse the xml file in such a way so that I should be able to fetch the default value for all the attribute that are not present in the XML(from xsd). The issue is that I couldn't find any appropriate parser in perl for this Job.I could find a parser that is able to validate the file but couldn't get the default value of attributes that are not present the XML. Can you please suggest me any parser/module that can help me in getting the required data.

Note: I need the values of the attributes that are not present in the XML to make a complete record for database insertion.

Thanks for your time,


You might want to take a look at XML::Compile. It appears to me that the default values feature is supported, but I've never actually used the module at all.


You could also change the database schema so all fields have defaults.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜