Also you should never create XML without checking that things are
properly escaped.
For instance what happens if there's a double quote in the title, or
non-ascii characters?
Florent
On 23 May 2007, at 09:01, Winterflood, Jonathan wrote:
Hi,
I don't know what NXLucene is expecting, so I can't help you there;
However, your data is not valid XML: you seem to have forgotten
some quotes:
- <field id="title" value="%s" type=text>
+ <field id="title" value="%s" type="text">
.. ^here
Hope it helps,
Jonathan
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:cps-devel-
[EMAIL PROTECTED] De la part de Ram Peters
Envoyé : mardi 22 mai 2007 23:32
À : [email protected]
Objet : [CPS-devel] NXLucene XMLRPC: NOT WELL FORMED error
I have the following xml that sent by xmlrpc to index the content. I
am getting a "NOT WELL FORMED." error.
I want to know how the data should be structured and sent to NXLucene
Server to index.
thnx.
=============================
MY XML:
xml_to_index = """<?xml version="1.0" encoding="UTF-8"?>
<doc>
<fields>
<field id="title" value="%s" type=text>
</field>
</fields>
</doc>""" % (title)
uid = 1
s = xmlrpclib.Server('http://192.168.196.131:9180')
s.indexDocument(uid, xml_to_index, False, False)
================================================
MY ERRORS:
2007/05/17 01:43 EDT [HTTPChannel,0,192.168.196.131] 192.168.196.131 -
- [17/May/2007:05:43:00 +0000] "POST /RPC2 HTTP/1.0" 200 297 "-"
"xmlrpclib.py/1.0.1 (by www.pythonware.com)"
2007/05/17 01:43 EDT [HTTPChannel,1,192.168.196.131] Traceback (most
recent call last):
File "/usr/lib/python2.4/site-packages/twisted/web/
http.py", line
601, in requestReceived
self.process()
File "/usr/lib/python2.4/site-packages/twisted/web/
server.py", line
160, in process
self.render(resrc)
File "/usr/lib/python2.4/site-packages/twisted/web/
server.py", line
167, in render
body = resrc.render(self)
File "/usr/lib/python2.4/site-packages/twisted/web/
xmlrpc.py", line
117, in render
defer.maybeDeferred(function, *args).addErrback(
--- <exception caught here> ---
File "/usr/lib/python2.4/site-packages/twisted/internet/
defer.py",
line 107, in maybeDeferred
result = f(*args, **kw)
File "src/nxlucene/server/xmlrpc.py", line 80, in
xmlrpc_indexDocument
File "src/nxlucene/server/xmlrpc.py", line 169, in
_indexDocument
File "src/nxlucene/server/xmlquery.py", line 47, in __init__
File "<string>", line 85, in XML
exceptions.SyntaxError: not well-formed (invalid token): line
7, column 47
2007/05/17 01:43 EDT [HTTPChannel,1,192.168.196.131] 192.168.196.131 -
- [17/May/2007:05:43:13 +0000] "POST /RPC2 HTTP/1.0" 200 263 "-"
"xmlrpclib.py/1.0.1 (by www.pythonware.com)"
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
This message contains information that may be privileged or
confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are
not the intended recipient, you are not authorized to read, print,
retain, copy, disseminate, distribute, or use this message or any
part thereof. If you receive this message in error, please notify
the sender immediately and delete all copies of this message.
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com http://www.nuxeo.org +33 1 40 33 79 87
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel