Home > Archive > PostgreSQL Discussion > January 2006 > xml_valid function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xml_valid function
George Pavlov

2006-01-26, 4:57 pm

Not sure what the correct forum for pgxml/xml2 questions is. I was
wondering what is the definition of "valid" that the xml_valid(text)
function that is part of that module uses? It seems different from the
W3C definition of "valid" XML (is there an implicit DTD?) Maybe it is
more akin to "well-formed"?

George

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

John Gray

2006-01-27, 8:24 pm

On Wed, 25 Jan 2006 17:11:04 -0800, George Pavlov wrote:

> Not sure what the correct forum for pgxml/xml2 questions is. I was
> wondering what is the definition of "valid" that the xml_valid(text)
> function that is part of that module uses? It seems different from the
> W3C definition of "valid" XML (is there an implicit DTD?) Maybe it is
> more akin to "well-formed"?
>


It is indeed well-formed. That just seemed a long name for the function!

Regards

John

Roger Hand

2006-01-27, 8:24 pm


John Gray wrote on
Friday, January 27, 2006 12:24 PM
> On Wed, 25 Jan 2006 17:11:04 -0800, George Pavlov wrote:
>
>
> It is indeed well-formed. That just seemed a long name for the function!
>
> John


Valid means it's been checked against, and conforms to, a DTD. If it hasn't been then it can't
be said to be valid.

-Roger

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

John Gray

2006-01-27, 8:24 pm

On Fri, 2006-01-27 at 12:32 -0800, Roger Hand wrote:
> John Gray wrote on
> Friday, January 27, 2006 12:24 PM
>
> Valid means it's been checked against, and conforms to, a DTD. If it hasn't been then it can't
> be said to be valid.
>


I know that - my point was just that when I was naming the functions, I
(perhaps foolishly, in hindsight) decided that xml_wellformed seemed a
longish name for a basic function. The README does in fact state that it
checks well-formedness and not validity. It's easily changed in the SQL
file if you'd rather have a different name for your installation.

As for changing it in the distribution, I can see some
backward-compatibility issues (I suspect it may be in production use
under that name) - but if there were to be a version which validated a
document against a DTD it would be a two parameter version which would
therefore have a different signature for PG.

Regards

John



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Scott Marlowe

2006-01-27, 8:24 pm

On Fri, 2006-01-27 at 15:21, John Gray wrote:

> I know that - my point was just that when I was naming the functions, I
> (perhaps foolishly, in hindsight) decided that xml_wellformed seemed a
> longish name for a basic function. The README does in fact state that it
> checks well-formedness and not validity. It's easily changed in the SQL
> file if you'd rather have a different name for your installation.
>
> As for changing it in the distribution, I can see some
> backward-compatibility issues (I suspect it may be in production use
> under that name) - but if there were to be a version which validated a
> document against a DTD it would be a two parameter version which would
> therefore have a different signature for PG.


A lot of validators make it clear that you can validate xml with or
without a DTD. So, it makes sense to have an overloaded xml_valid()
function that accepts a single argument (plain xml) and a two parter
that takes xml and a dtd as the two arguments.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com