문제

I have a few such namespace definitions in every xml file :-

xmlns:xi="http://www.w3.org/2001/XInclude" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
etc etc

Is there a way for me to specify these as defaults so that I don't have to write this in each and every XML file?

If it helps, I am primarily using xerces-c for parsing but I'd prefer a library independent solution.

도움이 되었습니까?

해결책

@owagh, instead of writing the XML file from scratch each time, have you considered defining an XML template that contains all of the applicable namespaces? Your program can then start by first loading that XML template and then begin populating it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top