[kde-edu]: QDom/XML-Problem

Carsten Niehaus cniehaus at gmx.de
Fri May 20 17:19:03 CEST 2005


Hello

I have code like this:  <desc>This is a picture.<img src="e.png" /> do you 
like it?</desc>

I have <desc> as a QDomElement. No Problem. I need a QString from that element 
that looks like this: 

"This is a picture: <img src="/usr/share/kde/kalzium/data/e.png" /> do you 
like it?

I am parsing xml to generate html from it but of course every system has a 
different &PATH for the pictures.

My problem is: How do I write the filename (inclusive the correct path) at the 
correct position in the QString? It is easy to get the text of <desc> and the 
value of <img src="" />, only the position is my problem.

Any ideas?

Carsten


PS: This is the complete structure of my file:

<knowledge>
·   <item>
·   ·   <name>Name of a item</name>
·   ·   <desc>some text <img src="e.png" /> more text</desc>
·   ·   <ref>Boilingpoint,Meltingpoint</ref>
·   </item>
</knowledge>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-edu/attachments/20050520/dfc7d88d/attachment.pgp


More information about the kde-edu mailing list