Scribusoid

Author Topic: Element order in the XML file  (Read 748 times)

eudoxos

  • Newbie
  • *
  • Posts: 24
  • Karma: 0
  • Scribus User
Element order in the XML file
« on: July 02, 2017, 12:56:30 am »
Hi, I am moving to editing the SLA file with python and ElementTree directly (instead attempting to extend scripter). I am currently working on comic translation and merging collaboratively updated translation form google docs (downloaded as plain text) into the scribus file. The ordering of text frames (with opaque background, in a layer above the background PDF of the original) is, obviously, important: the script finds some tag for page and then fills text frame line-by-line from the text file (each frame has default style assigned).

Can I somewhat rely on the ordering in SLA (in the implementation as it is now, 1.5.4svn) or is it arbitrary and changing and I better annotate (cumbersome) all text frames and use that as identifier? It seems frames are saved in the order as I created them?

Cheers! Vaclav

Nermander

  • Hero Member
  • *****
  • Posts: 1193
  • Karma: 15
Re: Element order in the XML file
« Reply #1 on: July 02, 2017, 08:54:50 pm »
From what I have read the order of items in the SLA is the order in which they were created. This would mean an added text frame on page 1 still ends up at the end of the SLA.

This may have changed lately, but I don't think so.

It has been said more than once that Scribus does not use XML in a well structured way.

sachinkhanna32

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Scribus User
Re: Element order in the XML file
« Reply #2 on: May 27, 2018, 12:37:55 pm »
The child elements in the XML document MUST appear in the order they are declared in the XSD schema. Only one of the child elements described in the XSD schema can appear in the XML document. The child elements described in the XSD schema can appear in the XML document in any order.

 

palmate