[olug] [OT]: C & XML

George Neill georgen at neillnet.com
Thu Nov 8 00:21:15 UTC 2012


Chad,

Seems odd you are being forced to use "C".  It seems like using xslt would
be a good fit here.  You'll have a couple of options,

1) There's a tool called xsltproc you could use.  The benefit would be no
"C" coding.

2) You could embed the "C" libxml2 xslt engine in your current process,
this would give you some flexibility to change easily in the future, if
needed.

Tell us more about the process, frequency of these updates, etc ...

Thanks,
George.


On Wed, Nov 7, 2012 at 3:07 PM, Chad Homan <choman at gmail.com> wrote:

> If I took a guess, it's libxml2. I like the looks of mini-xml, but I am not
> sure if I
> can introduce a new library at this time.
>
> to answer the other question.  currently I am trying to modify in place and
> write it out,
> because that's what most of the existing code does.  but whatever is
> easiest
>
> From my example:
>
>    - The existing code, loops cur_node until is sees "data"
>    - Fires a second loop child_node, string comparing each item:
>       - if strcmp(child->name, "data1"):
>          - xmlSetProp(child, "name", new_value)
>       - if strcmp(child->name, "data2"):
>          - xmlSetProp(child, "name", new_value)
>
> Unfortunately this would add new or remove outdated entries, so what I am
> trying to do is
>
>    - The existing code, loops cur_node until is sees "data"
>    - Fires a second loop child_node, string comparing each item:
>       - if strcmp(child->name, "data1"):
>          - NewFunc(child, list_of_objects)
>          - if strcmp(child->name, "data2"):
>          - NewFunc(child, list_of_objects)
>
> so the newFunc, currently loops though the list_of_objects, but I'm having
> issues
> getting the correct APIs together to: clean-house and create new objects
>



More information about the OLUG mailing list