Re: [xml] Retrieve all namespaces

2016-07-07 Thread Piotr Sipika
07.07.2016 5:12 PM "Martin Siggel" napisaƂ(a): > ... > Is there any function in libxml, to retrieve a list of all namespace > and prefixes used in the xml file? Hey Martin, See if the nsTab property of the xmlParserCtxt [1] is what you're after. [1]: http://xmlsoft.org/html/libxml-tree.html#xml

[xml] Dumping xmlSchemaPtr to file as XML

2015-02-25 Thread Piotr Sipika
Hi All, I'm trying to create a 'flat' XSD file from multiple XSDs linked via . I am able to successfully generate an xmlSchemaPtr, which contains all the other (included) schemas and dump its state to file *as object state* not as XML. Is there a way for me to covert the aggregate xmlSchemaPtr bac

Re: [xml] How to insert CDATA node in a xml tree

2012-10-24 Thread Piotr Sipika
> Which function from API is needed to include data CDATA in a xml tree ? Try xmlNewCDataBlock [1]. > Do you have a small sample ? No, but if you look at the code sample page [2], you should be able to find examples of adding child nodes into a document (see tree2.c). [1]: http://xmlsoft.org/ht

Re: [xml] xml find and replace

2012-07-12 Thread Piotr Sipika
On 07/12/2012 09:53 AM, stuart shepherd wrote: > Searching the web I've seen some examples in XSLT on how to > do something like this, but I have never used XSLT. Does anyone know if > there is a way to do this in XML. XSLT is your best bet. Here's a sample stylesheet which will: - change the na

Re: [xml] Working with base schema definitions

2012-06-05 Thread Piotr Sipika
Abhishek Padmanabh wrote: >> Any ideas how I can provide 2 schema files to libxml2 without explicit >> dependencies such that it is able to find types in respective >> namespaces from base schema document. Or if not then if there is any >> other way to achieve this? Btw, xerces-c++ was able to hand

Re: [xml] Remove whitespaces from text nodes

2012-02-14 Thread Piotr Sipika
On 02/14/2012 03:13 PM, Michael Ludwig wrote: > spam.spam.spam.s...@free.fr schrieb am 14.02.2012 um 10:59 (+0100): >> Is there a function which do this work? > > Don't know the C API, but in XSLT there's the function normalize-space() > and it does just what you want, so you might want to take a

Re: [xml] Problem Creating DTD for programatically generated document

2012-01-24 Thread Piotr Sipika
On 01/24/2012 01:09 PM, Michael Maul wrote: > The below appears to conform to the meaning of the AIP doc vor xmlNewDtd > dtd2 = > xmlNewDtd(xml_doc3,"HTML","http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd","-//W3C//DTD > XHTML 1.0 Strict//EN"); > However when the document is dumped it yeilds

Re: [xml] Problem using xmlUnlinkNode

2011-12-28 Thread Piotr Sipika
On 12/28/2011 02:19 AM, John J. Boyer wrote: > I need to delete some nodes from a parse tree. So I use xmlUnlinkNode > and then xmlFree. However, when I output the tree with xmlDumpDoc the > nodes are still there. What am I missing? It's difficult to say without seeing what you're doing exactly.

Re: [xml] libxml2 does xmlSchemaValidateDoc() support xml schema extensions?

2011-12-15 Thread Piotr Sipika
[] contents of zoo.xml: $ cat zoo.xml http://www.example.org/Zoo"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> Blue Fin Tuna 4 Hope you get things sorted out. Piotr (1) - http://www.w3.org/TR/REC-xml-names/#ns-decl /** * Samp

Re: [xml] libxml2 does xmlSchemaValidateDoc() support xml schema extensions?

2011-12-13 Thread Piotr Sipika
On 12/12/2011 09:12 PM, Andy Davidson wrote: > Does anyone know if libxml2 > supports http://www.w3.org/TR/xmlschema-0/#DerivExt ? > Yes, libxml2 does support complex type derivation by extension. I am aware of one bug inside libxml2 schema processing, but that is with simple-list-type extensi

Re: [xml] Problem reading inner text when parsing through xpatha

2010-06-15 Thread Piotr Sipika
Ram, Innext text Innext text Innext text Innext text I am using something like this to parse xmlXPathObjectPtr result = GetXpathNodes(xpath); //Assuming this gets me the xpathObjectPtr

Re: [xml] cross compiling libxml2 with mingw

2010-05-13 Thread Piotr Sipika
Aaron, Still not finding them. Here is the entire build log: http://gist.github.com/400240 That's weird... Here's my configure line. The difference might be explicitly pointing CC to i386-mingw32-gcc (even though PATH is set correctly): ./configure CC=/opt/mingw32/bin/i386-mingw32-gcc

Re: [xml] Validating XML file against XSD Schema

2010-05-06 Thread Piotr Sipika
Would someone please let me know how I can validate an XML file against its XSD Schema file. If there are validation errors I would then like to extract the human readable error description. You can find an example implementation here: http://wiki.njh.eu/XML-Schema_validation_with_libxml2 It's

Re: [xml] XML Schema, unique and namespaces

2010-04-13 Thread Piotr Sipika
Hey, Hi! I'am trying to write a xml schema which must validate that a given attribute is unique. ... ... I belive my problem is, that I can not figure out the correct xpath to write in the selector. Yes. It seems that you want every child (at any level) of 'root' that is in the

Re: [xml] XML Schema, unique and namespaces

2010-04-13 Thread Piotr Sipika
> Hi there. A few points: > > * Not sure this list is really an appropriate place to ask questions > about the W3C XML Schema Language. Very true, but libxml2 supports (albeit incompletely) validating XML documents with XSD, so any questions pertaining to that are valid. > * Why are you usi

Re: [xml] error restricting complexType list (parsing official, GML schema)

2010-03-23 Thread Piotr Sipika
I apologize if this is a double-post, my initial reply did not make it to the list. Looking for input regarding this [possible] bug: Robert Coup wrote: ... gml_error.xsd:15: element complexType: Schemas parser error : local list type: A type, derived by list or union, must have the simp

Re: [xml] xml Digest, Vol 71, Issue 9

2010-03-15 Thread Piotr Sipika
Robert Coup wrote: ... gml_error.xsd:15: element complexType: Schemas parser error : local list type: A type, derived by list or union, must have the simple ur-type definition as base type, not '{http://www.example.org/gml}doubleList'. WXS schema gml_error.xsd failed to compile This mig

Re: [xml] DTD validation & whitespace removal

2010-02-04 Thread Piotr Sipika
John, Try parsing the document using: xmlReadFile(URI, encoding, options) with options set to XML_PARSE_NOBLANKS (in addition to anything else you want to use) Here's what I mean: #include #include #include #include int main(int argc, char **argv) { if (argc != 2) { fprintf(st

Re: [xml] xml Digest, Vol 64, Issue 2

2009-08-03 Thread Piotr Sipika
Jerzy Jalocha N wrote: I would like to use a RELAX NG schema that is embedded inside some "outer" XML file: Sadly, xmllint (2.6.32) complains about an empty schema: exa