Page 1 of 1

Advice needed on WML structure

PostPosted: Wed Mar 03, 2010 9:53 pm
by Animal
Thanks to Jason for helping me with my project.

I can create content, headers, footers (with embedded automatic page numbers in thanks to his hint about using XmlUtils.unmarshalString), page background images using an image embedded in the header (Again, thanks for viewtopic.php?f=6&t=242)

I now have a question that is more about the structure of the WML language and what elements to use.

I have the 5500 page ISO 29500-1-2008 standard open which I do refer to. But it's a huge document, and I sometimes go round in circles looking for features in it.

Basically, I am transforming a simple XML page description into a document. So, I may have an address part which is precisely positioned within a box (provided by the background image)

Code: Select all
        <container left="10mm" top="30mm">
            <block>HOP LUN LTD HK</block>
            <block>32/F 9 WING HONG</block>
            <block>CHEUNG SHA WAN</block>

Which transforms to XSL-FO easily. <xsl:block> elements can be positioned absolutely, and can also contain other <xsl:block> elements. So the <container> becomes an <xsl:block>, and so do its children.

But in WML, Paragraphs cannot contain other Paragraphs.

So the <container> tag becomes a Paragraph with a <w:framePr w:x="nnn" w:y="nnn" w:vAnchor="page" w:hAnchor="page" w:wrap="none"/> element in it. Measurements converted to TWIPs, and that's fine.

But I then cannot create the sequence of <blocks> running down inside it because WML doesn't allow it.

What alternatives do I have? Is there another block-level element (I mean in the HTML sense, block elements being each on their own line) which I can use inside of Paragraphs, or is there a higher level element which I can use as an absolutely positioned <container>?

Thanks for any suggestions.

Re: Advice needed on WML structure

PostPosted: Wed Mar 03, 2010 10:01 pm
by Animal
Maybe I can use a text box as the container.

I'll reverse engineer a page with a text box in it!

Re: Advice needed on WML structure

PostPosted: Wed Mar 03, 2010 10:48 pm
by Animal
Actually, each block within the container just must be a Paragraph and if they all "inherit" the same <w:framePr> element, they'll all be put in the same frame.

So I just have to register when I enter a <container> and set up a <w:framePr> which any subsequently created paragraphs must use.

Re: Advice needed on WML structure

PostPosted: Thu Mar 04, 2010 12:24 am
by jason
I don't have much on this topic to contribute, I'm afraid, except to say that frames were the original technology, superseded for most purposes by text boxes when the latter were introduced in the late 90's. Google throws up a few pages on the differences between the two, one of which is referenced in the Wave embedded in my blog. cheers .. Jason