Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

XmlSaxParser Namespace and other things

Moderators: larsivi kris

Posted: 08/12/08 20:18:17 Modified: 08/12/08 20:40:23

Hi,

when I have element like this <ns:myel>...</ns:myel> why the 'ns' is missing in the start element notification? How to retrieve it? Also if I have CDATA inside the elements it is skipped and the entities are not decoded. How to fix these?

Thanks, bobef

Author Message

Posted: 08/12/08 22:54:03

I can explain one aspect, but not the others: entities are not decoded implicitly -- you have to explicitly decode them yourself, as necessary, via the DocEntity? module within the xml package. Can't say why namespace tags are not propagated by the SAX api, or why cdata doesn't appear to operate correctly -- those sound like bugs in the SAX api implementation.

Would suggest filing a bug report and assigning to the SAX implementation author (stonecobra)

Posted: 08/14/08 06:16:35

OK I switched to xml.Document and it is working fine now. But is there a way to find out the position (line,column) in the stream of the different elements? I am doing little experiment. Something like XUL using DWT and when the scripts are reporting problems the user needs to know where they occur. Also, is it possible to parse some elements (<script>) as CDATA? I guess this is not part of the XML specs, but maybe the parser could be customized somehow?

Thanks, bobef

Posted: 08/16/08 03:41:59

didn't add newline counters to the codebase, primarily because it slows things down considerably (sounds daft, I know) but suspect many ppl would want that. Will looks at how to do it via some other mechanism