This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > April 2006 > Tricky newline issue





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Tricky newline issue
CBC

2006-04-13, 7:00 pm

HI All,

First up, let me give you the structure fo the XML file I am trying to
"WordML"-ify. An example would be
<records>
...

...
<entry>
<record>
<content>Some content</content>
<content>Some more content</content>
</record>
<other children for entry>
</entry>
...
...
</records>

The output that I want in the resulting Word doc is
Some content

Some more content

In other words, between <content> children of every <record> child of
every entry element, I want a newline.

I have tried the following thus far:
1. Insert a dummy node called <nl /> between two <content> nodes and
then during the <xsl-for-each> for the "record" node's children, check
if the local-name(.) is 'nl' and if yes, output <w:p/>. However, this
doesn't work

2. Have a <w:p/> text inside a "content" node, say at the end, and have
a 'disable-output-escaping="yes"' when using an <xsl:value-of> for the
"content" nodes. This doesn't work either, and I don't think it should
as well, since the source document will complain about the validity or
the existence of the w: namespace. I am not sure if declaring the
WordML namespace in the XML document will help.

Can anyone tell me how do I go about achieving this newline between
text? I am sorry if the example or the description is unsatisfactory in
clarity, but this is not a conjured-up example, it's a real-life
document I am having to work with. If any more information is required,
please let me know.

Thanks to all those who help.

Regards

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews