Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeFormatter: Handling of XML nodes. #5

Open
ldoblies opened this issue Jan 21, 2013 · 0 comments
Open

CodeFormatter: Handling of XML nodes. #5

ldoblies opened this issue Jan 21, 2013 · 0 comments

Comments

@ldoblies
Copy link
Contributor

XML nodes are not formatted yet, they are written as-is. The opening tag starts at the same
column as in the input, if the tag is put on its own line.

Example:

  let $works := <works>
      <employee name="1" />
    ...

Formats to:

let $works := 
                <works>
      <employee name="1" />
        ...

<works> is on a new line because the Expr on the right-hand-side of the LetBinding is multiline.

If we don't format XML nodes, we could e.g. put the top-level starting tag on the same position as the top-level closing tag. A problem with not formatting xml nodes is that the indentation of the XML markup in the input is (usually) written with respect to the other content, which might get formatted differently by the formatter. Indenting the surrounding code differently usually makes the XML markup look out of place.

If we format XML nodes, we need to make sure we respect the Boundary Space Policy (http://www.w3.org/TR/xquery-30/#dt-boundary-space-policy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant