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

Strict namespace handling #641

Open
pgundlach opened this issue Dec 19, 2024 · 0 comments
Open

Strict namespace handling #641

pgundlach opened this issue Dec 19, 2024 · 0 comments

Comments

@pgundlach
Copy link
Member

pgundlach commented Dec 19, 2024

The speedata Publisher is currently very namespace ignorant. This is getting better with the new XPath parser (lxpath).

For example: the following data

<bar:data  xmlns:bar="foons">
    <bar:child>
        <bar:sub>sub</bar:sub>
    </bar:child>
</bar:data>

should be parsable in default mode with

<Record element="data">

and in "strict" mode with

<Record element="foo:data">

where the foo-namespace is foons.

This could be a complete layout:

<Layout xmlns="urn:speedata.de:2009/publisher/en"
    xmlns:sd="urn:speedata:2009/publisher/functions/en"
    xmlns:foo="foons">

    <Options namespaces="strict" />

    <Record element="foo:data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <Value>Hello world</Value>
                </Paragraph>
            </Textblock>
        </PlaceObject>

        <ProcessNode select="*:child" />
    </Record>

    <Record element="foo:child">
        <Message select="name()"></Message>
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <Value select="namespace-uri()" />
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

should print / output bar:child and and foons

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