Perhaps a better approach is not to worry about
space normalization at all, and use a CSS style
sheet to control formatting for display.  You have
much finer control and you've removed presentation
concerns from the code that produces the content.

foo.xqy:

<html>
<head>
<title>Test</title>
<link rel="stylesheet" href="foo.css" media="screen" />
</head>
<body>
<input type="text" value="" />
<select>
        <option>One</option>
        <option>Two</option>
</select>
<input type="submit" value="Go" />
</body>
</html>

foo.css:

input {
        margin-right: 2em;
}

select {
        margin-right: 2em;
}

On Sep 29, 2008, at 9:59 AM, Eric Palmitesta wrote:

Yep, that's what I was looking for.

It's still a bit ugly:

<input type="text" value="" />
{ '&nbsp;' }
<select>
        <option>One</option>
        <option>Two</option>
</select>
{ '&nbsp;' }
<input type="submit" value="Go" />

But it's better than something like:

<input type="text" value="" />&nbsp;<select>
        <option>One</option>
        <option>Two</option>
</select>&nbsp;<input type="submit" value="Go" />

Much thanks,

Eric

Florent Georges wrote:
Florent Georges wrote:
In the later example, white space nodes around the curly braces and
the span element are discarded. In the former example, the text node
between the curly braces and the span element is not a white space
node
anymore, because of the non-breakable space character.  So it is
added
to the result tree.
Oh, and I forgot...  You should be able to get what you want using
this (not tested):
  <p>
     { <b>hi</b> }
     { '&nbsp;' }
     <span class="blah">there</span>
  </p>
Regards,
--drkm
    _______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

---
Ron Hitchens [EMAIL PROTECTED]  650-655-2351




_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to