libxml and Libxslt updates
BlitzMax Forums/Brucey's Modules/libxml and Libxslt updates
| ||
It seems to be that time of the year again for a new BaH.Libxml release. Version 1.14 brings these changes : * Updated to Libxml 2.7.4. * Fixed TxmlTextReader cleaning up string before it had finished using it. * Added xmlParserMaxDepth global variable. * Added utf-8 BOM detection/strip for doc string parsing. * Fixed Win32 saving issue when compression was set. * Added TStream support to saveFile() and saveFormatFile(). * Removed some source files which were not part of the library. Libxml 2.7.4 was released on September 10, so we are right up-to-date now :-) With this release comes its little brother, BaH.Libxslt. Version 1.02 for libxslt brings these changes : * Updated to Libxslt 1.1.25 Which keeps them in sync. For those who don't know, XSLT can be used to transform XML into other formats with relative ease. (perhaps not very useful for games, I admit, but hey, it's there if you need it!) Both releases can be downloaded from the usual place - the MaxMods googlecode repository. Built and tested on BlitzMax 1.33 and 1.34, OSX 10.6.1, Win32 cross-compile, XP SP2, Ubuntu 9.04. Have fun :o) |
| ||
how do you set the parser option XML_HUGE? |
| ||
I've no idea. What's that for? |
| ||
Ah. I see now : XML_PARSE_HUGE It has a value of '1 Shl 19' (if you want to pass it in to a function like FromFile). I'll add it, and a couple of others, to the module properly. |
| ||
I've updated SVN with the new options - XML_PARSE_OLD10, XML_PARSE_NOBASEFIX, XML_PARSE_HUGE and XML_PARSE_OLDSAX. |
| ||
thanks! |
| ||
Is there a way to use XML_PARSE_HUGE with the SAX2 parser? atm I just found appropriate parameters in the txmltextreader::fromFile/fromDoc functions.. but the SAX parsing is just more comfortable imho. [Edit:] How can I access your SVN webspace? |
| ||
SVN is available here : http://code.google.com/p/maxmods/source/checkout Is there a way to use XML_PARSE_HUGE with the SAX2 parser? You want access to the SAX2 API via the xmlSAXHandler object? |
| ||
Aah thank you.. You want access to the SAX2 API via the xmlSAXHandler object? Not sure about the internals.. I hoped for being able to parse >10MB nodes using the Txmldoc::ParseFile function.. my prob is i'd have to rewrite some major parts of a collada loader I wrote based on TxmlDoc Functionality, if there was no way to tell the parser not to raise this error using this function [which I assumed after some reading the docs to be "sax2" parsing.. am I actually right about that?]. |
| ||
I thought that the TxmlTextReader was meant to provide similar functionality to SAX2? It should also, in theory, handle larger nodes, because it's not attempting to load everything into RAM at the same time. You can also pass "options" into the textreader create functions. The SAX2 parser uses callback functions. I'd have to investigate the feasibility of wrapping that against BlitzMax functions/methods. |
| ||
This is .. kinda uncomfortable to hear /: .. As I said, as the TxmlTextReader functionality is totally different from the TxmlDoc functionality, I'd have to rewrite 1k lines of code, and that for an implementation that is propably actually a downgrade of the TxmlDoc functions. I.. uh.. just need this within the next week, so.. if you are just stuck somewhere else atm, then I do not want to waste your time there, and I'll just do the rewrite.. but it MUST BE POSSIBLE to pass this option anyhow, mustnt it!? :( |
| ||
Okay, I finally saw what your problem was. The default TxmlDoc functions - parseFile() and parseDoc() - don't have an "options" parameter, which means therefore, that you can't use XML_PARSE_HUGE through that API. So, I researched the API some more, and found some other functions which have similar functionality on TxmlDoc, but which do have the options parameter. I've now added these to SVN. They are, readFile(), and readDoc(). Interfaces : Function ReadFile:TxmlDoc(filename:String, encoding:String = "", options:Int = 0) Function ReadDoc:TxmlDoc(doc:Object, url:String = "", encoding:String = "", options:Int = 0) readFile() expects a filename or valid URL. It supports "incbin::" filenames. readDoc() requires either a String or TStream. When a String, this should be a String of valid XML. If you pass in a TStream, you will have to close it yourself afterwards. All params, other than the first, are optional. The encoding parameter might be something like, "UTF-8". Example usage for streams : Local stream:TStream = ReadStream(filename) Local doc:TxmlDoc = TxmlDoc.ReadDoc(stream) .... Any other questions or issues, please let me know. :o) |
| ||
Okay, I finally saw what your problem was. The default TxmlDoc functions - parseFile() and parseDoc() - don't have an "options" parameter, which means therefore, that you can't use XML_PARSE_HUGE through that API. Exactly. So, I researched the API some more, and found some other functions which have similar functionality on TxmlDoc, but which do have the options parameter. I've now added these to SVN. They are, readFile(), and readDoc(). I cant express how much you rule, thanks for the effort!! |