Re: Postgresql XML parsing - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Postgresql XML parsing
Date
Msg-id 5321D70C.2030703@dunslane.net
Whole thread Raw
In response to Re: Postgresql XML parsing  (Ashoke <s.ashoke@gmail.com>)
List pgsql-hackers
On 03/13/2014 11:27 AM, Ashoke wrote:
> Hi,
>
>   Thanks for the input. I would look into JSON parsing as well, but 
> the requirement is XML parsing.
>
>   There is no DTD/Schema for the XML. Is there any way I could know 
> what are the possible tags and their values? I am building my parser 
> based on the output PostgreSQL produces (hard coding the tags) and I 
> am afraid I would miss out on tags.
>

No, it's not possible, since modules can hook in and add their own nodes 
with arbitrary names (see for example the Postgres FDW which does this). 
You need to be able to handle arbitrary tags, even if it's by ignoring them.

cheers

andrew




pgsql-hackers by date:

Previous
From: David Johnston
Date:
Subject: Re: Is this a bug
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Store Extension Options