Re: [bdbxml] Beginners question with Perl

George Feinberg <[email protected]>
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Peter,

The error indicates that the problem is not in the query, but in
the parsing of a document during the query.

Do your documents reference external entities/DTDs?
In your function that creates the XmlManager, add the
flag, DBXML_ALLOW_EXTERNAL_ACCESS to the
constructor, and see if that helps.

A way to avoid pathname/directory issues in queries
is to add aliases for containers once they are opened.
See XmlContainer::addAlias() for usage.  Aliases
can then be used in query expressions.  This feature isn't
your direct issue, but it sounds like you could use it.

Regards,

George

On Jul 19, 2005, at 10:01 AM, Peter Hickman wrote:

> I've created the following script
>
> setVerbose 0 0
>
> preload books.dbxml
>
> query '
> for $collection in collection("books.dbxml")/collection return  
> <link class="collectiontitle" title="{$collection/@title/text()}"  
> idref="{$collection/@id/text()}" />
> '
> print
>
> quit
>
> Which when run produces
>
> [Bible]$ dbxml -s test.xquery
> <link class="collectiontitle" title="analects" idref="b4"/>
> <link class="collectiontitle" title="Bhagavad-Gita" idref="b3"/>
> <link class="collectiontitle" title="bible" idref="b1"/>
> <link class="collectiontitle" title="koran" idref="b2"/>
> [Bible]$
>
> However in the perl script I cannot get away with giving anything  
> less than the full path to the data, ie /Users/peterhickman/Work/ 
> Bible/books.dbxml.
>
> Michael O\\\\\\\\\\\\\\\'Sullivan wrote:
>
>
>> Hi Peter,
>> Have you verified that the query behaves as you would like?
>> I'd recommend, running the dbxml shell, opening the container and  
>> adding the
>> document and then using the query method from the shell to debug  
>> your XQuery
>> statement. Once you know it works you can add it into your perl  
>> script.
>>
>> michael.
>>
>>
>>
>>
>>
>> ------------------------------------------
>> To remove yourself from this list, send an
>> email to [email protected]
>>
>>
>>
>>
>
>
>
> ------------------------------------------
> To remove yourself from this list, send an
> email to [email protected]
>
>



------------------------------------------
To remove yourself from this list, send an
email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.