[scribus] Python SQL fetch and formatting xml tags
José Antonio Rocha
joseantoniorocha at gmail.com
Thu Jan 26 14:26:29 UTC 2012
2012/1/26 Jean Mielot <j.mielot at gmail.com>
> Hi
>
> My magazine uses a php sql system that I built for importing stories into
> what used to be Indesign, but is now Scribus ; -)
>
> Indesign was able to import xml files and apply styles to matching tags.
> I am sure Scribus can do this with some python help AND one won't even
> have to go via an xml file and instead connect directly to the db.
>
> I just need some help with this script.
>
> 1. I need to be able to fetch a record's field (perhaps with a provided id
> for now).
> 2. Import the content (text) into a frame (probably the selected frame)
> 3. apply styles to matching tags ie. "<textem>this is italics</textem>"
> 4. Delete the tags
>
> I'm sure this is doable and I will try to do so but I think I specifically
> need help with 3 and 4.
>
> Any ideas?
>
> Thanks
>
You may:
1. parse the text with some Python XML parser
2. for each fragment in text:
1. insert text fragment
2. select the fragment
3. format the fragment
--
[image: Meira]
------------------------------
nome: "José Antonio Meira da Rocha"
googletalk: email: MSN: joseantoniorocha at gmail.com
veículo: [ http://meiradarocha.jor.br ]
------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20120126/02075b8b/attachment.html>
More information about the scribus
mailing list