Okay, you don't need worry about the encoding once
it's in the db. 

Also, check this XMLdbGUI tool to be sure it can
handle your encoding. Not all tools provide proper
support of  encodings. ( I personally use Attrezzo
plugin for the Eclipse IDE to browse and edit
documents in Xindice)

When the document is retrive try calling :

Resource res = results.nextResource();
System.out.println((String) res.getContent());

You should see a print out of each item in the result
with the <?xml?> line. Check the encoding of on this
line. If it is set to something other than UTF or
ISO-8859, you may have to do some work to keep you
encoding it sync.

Also the class I referred to was called
XindiceQueryResultWrapper. If pass the ResourceSet to
the constructor and then call setResultTag then
buildResultSet methods you can use one of the getter
method to get a complete DOM Document of your query
results or a string contain the xml.

if this all fails, you could alwas use windows
character mapper to determine what the hex vale of
those characters are a write a regular expression to
remove them from your document.

I will give the issue more thought tonight, and see if
any other solutions come to mind.

Cheers,
Evan
--- Josema Alonso <[EMAIL PROTECTED]> wrote:
> > Not to nudge too much into the inner working fo
> you
> > project, but it seems too me like you have a
> character
> > encoding issue. I've had these types of issue
> using
> > other languages. Usually they steam from an into
> put
> > source that is not encoding the file properly for
> OS
> > platform.
> I think it should be something like that. I'm
> developing on Windows XP
> Professional. Maybe my problems is cause I'm Spanish
> and running the locale
> version of the OS?
> 
> > My first question would are you running this
> project
> > on multiple platforms? (Linux, Solaris, NT, etc.)
> > If so if make your code has proper checks on the
> files
> > encoding. These squares look to me be like
> carriage
> > returns.
> I'm 99.9% sure these are carriage returns and tabs.
> 
> > I would also check to see if all your developers
> IDE
> > and editors are set to save is the same encoding
> > format.(ISO-8859-1, UTF-8, etc.) Try insert a new
> xml
> > document from your system into the DB and then
> > retrieve it. It help to see if it's just your
> machine
> > out of sync with the DB's encoding.
> I'm trying right now...
> Ok, I added one of the addressbook documents to a
> collection using XMLdbGUI.
> I set the encoding of the document to 'ISO-8859-1'
> before adding it. It was
> successfully except for the encoding. The encoding
> now in the DB is missing.
> I also tried setting the encoding to 'UTF-8' and
> it's missing too.
> 
> I guess this is a problem...how to fix it? May I add
> the documents using
> Java code and may I specify then the encoding? Is it
> possible to change the
> default encoding in Xindice by Java code or by conf
> file?
> 
> > Also, earlier I posted ( email title:  A Solution
> to a
> > few XML result set problems) sample class that
> > retrives nodes from getContentAsDOM method and
> returns
> > it as a DOM Document, DOM4J Document, or as a UTF
> > string. You might want to take a look and see if
> it
> > will help your project.
>  I tried, but I have the very same problem you
> mentioned in your followup
> post, when you get the org.w3c.dom.DOMException:
> DOM003: Namespace error.
> 
> > I'm sorry I could not be more help.
> No sorry. Thank you very much! :-)
> 

Reply via email to