When I was fetching and parsing some html documents with
let $doc := http:send-request(<http:request method='get' href='{$url}'/>)
I am getting an error:
[FOHC0001] An HTTP error occurred: "1323441640568.xml" (Line 475): Invalid
character found: 'µ'.
It seems base is not able to handle special chracter 'µ'.
Erol Akarsu
Dear all at BaseX,
1. just in case... are databases created with BaseX 6.5 (and so backups)
compatible with BaseX 7.0 ?
2. Is there a way to load several binary resource files with only one
command or xquery function (like ADD or db:add for textual resources) ?
Thank you for your fanstatic job.
regards,
Fabrice ETANCHAUD
Senior Software Engineer
edital
Berkenlaan 1
B-1831 Brussels, Belgium
<skype:fabrice.etanchaud?call>
+32 2 716 32 32 general
+32 2 716 32 20 fax
fetanchaud(a)edital.com
corsearch.com <http://www.corsearch.com/> | edital.com
<http://www.edital.com/>
Confidentiality Notice: This email and its attachments (if any) contain
confidential information of the sender. The information is intended only
for the use by the direct addressees of the original sender of this
email. If you are not an intended recipient of the original sender (or
responsible for delivering the message to such person), you are hereby
notified that any review, disclosure, copying, distribution or the
taking of any action in reliance of the contents of and attachments to
this email is strictly prohibited. If you have received this email in
error, please immediately notify the sender at the address shown herein
and permanently delete any copies of this email (digital or paper) in
your possession.
Hello,
I am getting to know Basex702. I downloaded the war and
its receiving requests at http://localhost:8080/BaseX702/rest (tomcat
servlet container)
I am using curl to query the REST urls for results. I used the command
below to populate the initial data
*$$ curl -i -X PUT -H "Content-Type: application/xml" -T
"/tmp/bv_letsbuycom_standard_client_feed.xml" "admin:admin@localhost
:8080/BaseX702/rest/bvstandard"*
To confirm the PUT above i do this:
*$$ curl -i "admin:admin@localhost:8080/BaseX702/rest/bvstandard"*
....
......
<rest:database name="bvstandard" resources="1" xmlns:rest="
http://www.basex.org/rest">
<rest:resource type="xml" content-type="application/xml"
size="828733">bvstandard.xml</rest:resource>
</rest:database>
Another confirmation
*$$ curl -i "admin:admin@localhost
:8080/BaseX702/rest/bvstandard/bvstandard.xml"*
*
*
The above shows the entire xml. So the data got loaded fine i believe.
Now i am stuck. a query like below is not resulting any results. The xml
document surely contains the path and data.
*$$ curl -i "admin:admin@localhost
:8080/BaseX702/rest/bvstandard?query=/Feed/Product&wrap=no"*
There are multiple Product elements under the Feed element. And the above
query returns empty results. I know i am doing something fundamentally
wrong, but not sure what.
However, a request like
*$$ curl -i "admin:admin@localhost
:8080/BaseX702/rest/bvstandard?query=//@id"*
*
*
Shows results as expected, ie all the attributes *id * and its values are
displayed.
Please help.
Aren't the values of query param in the GET url above, a XPATH expression?
How to i execute a xpath on the DB to get the results, using the REST
interface.
The main purpose is to get some 100 MB large xml file into BaseX and then
query it using a php client and display results on a web page.
We at letsbuy.com is really interested in integrating BaseX in our
application for handling all the XML feeds we consume.
Please advice.
Thanks,
Subhro.
Dear all, I'm trying to download a jpg from the web and then write it in
a file.
Everything goes right, but at the end the file is not a valid image...
it contains extra bytes...
could you please tell me where I went wrong ?
declare default element namespace "http://www.w3.org/1999/xhtml";
file:write-binary('c:/fe/img.jpg',
http:send-request(<http:request method='get'
override-media-type=image/jpeg'/>,
http:send-request(<http:request method='get' />,
'http://www.patentsoffice.ie/eregister/register/TMRegister.aspx?idAppli=
2005/01446')[2]//img/@src[contains(.,'TM')]/data()
)
)
With a typeswitch I can see that the response body is a xs:base64Binary,
so it should fit correctly in the file:write-binary function...
best regards
Fabrice ETANCHAUD
Senior Software Engineer
edital
Berkenlaan 1
B-1831 Brussels, Belgium
<skype:fabrice.etanchaud?call>
+32 2 716 32 32 general
+32 2 716 32 20 fax
fetanchaud(a)edital.com
corsearch.com <http://www.corsearch.com/> | edital.com
<http://www.edital.com/>
Confidentiality Notice: This email and its attachments (if any) contain
confidential information of the sender. The information is intended only
for the use by the direct addressees of the original sender of this
email. If you are not an intended recipient of the original sender (or
responsible for delivering the message to such person), you are hereby
notified that any review, disclosure, copying, distribution or the
taking of any action in reliance of the contents of and attachments to
this email is strictly prohibited. If you have received this email in
error, please immediately notify the sender at the address shown herein
and permanently delete any copies of this email (digital or paper) in
your possession.
Hi,
I remember seeing some discussion of research into this a while back. I
have just got a Android tablet so was wondering what the state of play is
on this?
I come across JBED
http://forum.xda-developers.com/showthread.php?t=1189303which seems to
claim the ability to run jars though an emulation layer. I
tried this but it is looking for a midlet/jad descriptor file. I will
investigate this, but has anybody been down this route?
/Andy
I triggered a bug.
make
basex -q 'declare option output:cdata-section-elements "desc M";document{(doc("AMFMXTaiwan.gpx")//*:wpt[1]/*:desc/data())}'
Potential bug? Improper use? Your feedback is welcome:
Contact: basex-talk(a)mailman.uni-konstanz.de
Version: BaseX 7.0.2
Java: Sun Microsystems Inc., 1.6.0_26
OS: Linux, i386
Stack Trace: <--------------------by the way, there is 1 trailing whitespace here
java.lang.ArrayIndexOutOfBoundsException: -1
org.basex.util.list.TokenList.peek(TokenList.java:116)
org.basex.io.serial.OutputSerializer.finishText(OutputSerializer.java:230)
org.basex.io.serial.Serializer.text(Serializer.java:134)
org.basex.query.item.FTxt.serialize(FTxt.java:37)
org.basex.query.item.FDoc.serialize(FDoc.java:59)
org.basex.core.cmd.AQuery.query(AQuery.java:100)
org.basex.core.cmd.XQuery.run(XQuery.java:22)
org.basex.core.Command.run(Command.java:328)
org.basex.core.Command.exec(Command.java:309)
org.basex.core.Command.execute(Command.java:77)
org.basex.server.LocalSession.execute(LocalSession.java:142)
org.basex.server.Session.execute(Session.java:38)
org.basex.core.Main.execute(Main.java:139)
org.basex.BaseX.<init>(BaseX.java:89)
org.basex.BaseX.main(BaseX.java:54)
make: *** [3] Error 1
basex -q 'declare option output:cdata-section-elements "desc";document{data(doc("AMFMXTaiwan.gpx")//*:wpt[1]/*:desc)}'
causes a similar bug. Input was http://radioscanningtw.jidanni.org/images/radioscanningtw/maps/AMFMXTaiwan.…
All I was trying to do was figure out some way to do like
fn-bea:inlinedXML Parses textual XML and returns an instance of the XQuery 1.0 Data Model.
without having to say goodbye to basex.
You see I'm trying to figure how to get a inner shred of XML,
<description><![CDATA[<ul><li>復興廣播電台...</li><li>台北市士...</li><li>丙</li></ul>]]></description>
parsed just like the enclosing file. Maybe I need some "util:eval()".
You see I want to access the inner elements with //li[2] etc. instead of
matches(*:desc,concat('/li><li>(',$x,')')) like a dweeb. Help.
I have been using http module w/o any issue before.
Today, I tried it with latest release 7.0.2 but getting error "Error
parsing entity as XML or HTML."
Did I miss anything to run?
return http:send-request(<http:request method='get' href='
http://www.google.com'/>)
Error: [FOHC0002] Error parsing entity as XML or HTML.
Thanks
Erol Akarsu
Hi
Regarding the (not existent) requirement for attribute order:
In http://www.w3.org/TR/2008/REC-xml-20081126/#sec-starttags there is a
note "Note that the order of attribute specifications in a start-tag or
empty-element tag is not significant."
And my recommendation is: Do not put any extra requirements to any XML,
which is not really needed. In case of attributes, you may and up
promissing your consumers that the order of attributes will be as you
define, and later you may have problems switching tools, which follow W3C
recommendation, but not your extra promise.
So the general advice is: keep your promises at minimum possible, it will
easy work for you and also for your partners.
The same often applies, when people start insisting on certain XML
encoding, encoding or not encoding of special characters - all these
requirements are more cosmetic then practical and often do originate from
people, who do not understand the topic so well, but are well trained in
the exercise "find three differences it those two pictures".
Jan
*Ing. Jan Vlčinský*
CAD programy
Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic
tel: +420-597 602 024; mob: +420-608 979 040
skype: janvlcinsky; GoogleTalk: jan.vlcinsky(a)gmail.com
http://cz.linkedin.com/in/vlcinsky
On 2 December 2011 18:46, Dave Glick <dglick(a)dracorp.com> wrote:
> After a little more investigation of the XQuery Update standard, it looks
> to me like BaseX is doing this right and the standard does not allow for
> positioning of attribute insertions (unless there’s another approach I’ve
> overlooked). In case anyone else has a similar question – all insert
> operations involving attributes resolve to the function
> upd:insertAttributes which does not allow for positioning. It appears as
> though the modifiers “as first” and “as last” are ignored in the case of
> attributes.****
>
> ** **
>
> I suppose this makes sense if the ordering of attributes in XML is
> unimportant and undefined. Can anyone clarify what the XML/XDM standard has
> to say on the topic of attribute ordering? It’s a little confusing because
> many XML processors attempt to present attributes with some kind of
> explicit ordering (as an example, see the .NET XmlAttributeCollection class
> which allows programmatic insertion of attributes before/after a reference
> attribute).****
>
> ** **
>
> Thanks (again),****
>
> ** **
>
> Dave****
>
> ** **
>
> *From:* Dave Glick
> *Sent:* Friday, December 02, 2011 12:37 PM
> *To:* basex-talk(a)mailman.uni-konstanz.de
> *Subject:* Insert position of attributes****
>
> ** **
>
> How would one go about inserting an attribute at a specific position
> (i.e., somewhere other than at the front of the attribute list)? I would
> expect the following expression would do the trick: “insert node attribute
> aname {'avalue'} as last into //XYZ” but it still inserts the attribute at
> the front of the attribute list.****
>
> ** **
>
> By looking at the code in the InsertAttribute update primitive, I can see
> that it’s hardcoded to insert at the front of the attribute list. Does this
> mean that there is no way to control attribute insertion location? Does the
> XQuery Update standard not allow such an update or is this a bug/oversight
> on the part of BaseX?****
>
> ** **
>
> Thanks!****
>
> ** **
>
> Dave****
>
> ** **
>
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk(a)mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
>