Category : xml-parsing

Getting error extra ‘xzread()’ in xml error callback while parsing the XML using libxml. Usually observed when file is parsed which is residing in a persistent volume claim in Kubernetes cluster. Have not been able to reproduce this issue in local setup. Can’t get any meaningful information regarding this searching online. The error domain is ..

Read more

I have a xml document with a node which has children nodes but I want to iterate over specific nodes which names are stored in the array, for example: const char* childrenNodes[]={"childNodeA", "childNodeC", "childNodeK"}; I can use next_sibling function which takes as an argument the element of the above array. Do you have any idea ..

Read more

I am using the codesynthesis xsd to automatically generate c++ code to parse the xml. I have some xsd like this: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:mml="http://www.w3.org/1998/Math/MathML"> <xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="mathml3/mathml3.xsd"/> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> <xs:group name="text"> <xs:sequence> <xs:choice minOccurs="0"> <xs:element ref="b"/> <xs:element ref="i"/> <xs:element ref="sup"/> <xs:element ref="sub"/> <xs:element ref="u"/> </xs:choice> </xs:sequence> </xs:group> <xs:element name="AbstractText"> <xs:complexType mixed="true"> <xs:choice minOccurs="0" ..

Read more

I would like to insert a xml node at the top of other existing child nodes. The problem with my code is it appends to the bottom. I tried InsertBefore() but I keep getting errors Ex: <Providers> <—-I want to insert a provider here <provider> <id>87585857587</id> <type>AD</type> <name>Demo1</name> <event>saga</event> <username></username> <item>NEV</item> <password></password> </provider> </Providers> My ..

Read more

I’m trying to store the nested XML file: <?xml version="1.0" encoding="utf-8"?> <root> <type> <cars> <car name="Garfield" weight="4Kg"> <spec serial_="e_54" source ="petrol" mileage="56"/> <spec serial_="e_52" source="diesel" mileage="52"/> <spec serial_="m_22" source="electric" mileage="51"/> <additions source="steam" convert="153 0 1 0"/> </car> <car name="Awesome" weight="3Kg"> <spec serial_="t_54" source="petrol" mileage="16"/> <spec serial_="t_52" source="wind" mileage="62"/> <spec serial_="t_22" source="electric" mileage="81"/> <additions source="water" convert="123 ..

Read more

My XML file is nested as follow: <?xml version="1.0" encoding="utf-8"?> <root> <type> <cars> <car name="Garfield" weight="4Kg"> <spec serial_="e_54" source ="petrol" mileage="56"/> <spec serial_="e_52" source="diesel" mileage="52"/> <spec serial_="m_22" source="electric" mileage="51"/> </car> <car name="Awesome" weight="3Kg"> <spec serial_="t_54" source="petrol" mileage="16"/> <spec serial_="t_52" source="wind" mileage="62"/> <spec serial_="t_22" source="electric" mileage="81"/> </car> </cars> </type> </root> I wish to grab all "car" ..

Read more