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

Removing the namespace leaves {} prefix #289

Open
tacman opened this issue Jul 26, 2024 · 0 comments
Open

Removing the namespace leaves {} prefix #289

tacman opened this issue Jul 26, 2024 · 0 comments

Comments

@tacman
Copy link

tacman commented Jul 26, 2024

I know I'm doing something wrong here, but I can't figure out what it is.

<recodList xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <script/>
    <count>5487</count>

    <record>
        <Title>Le Havre</Title>
//        https://sabre.io/xml/reading
        $this->service->elementMap = [
            'record' => function(Reader $reader) {
                return keyValue($reader, 'recodList');
            },
            'recodList' => function(Reader $reader) {
                return repeatingElements($reader, 'record');
            },
        ];

I know the namespaces can be removed by declaring them in the call, but there's no namespace, besides the default. I've tried using that, and using {}, but I can't seem to get rid of the brackets in the key names.

array:24 [▼
  "{}Title" => "Le Havre"
  "{}Description" => null

Thanks again for this library, I struggle with parsing XML, but this has made it much easier. It's really quite remarkable.

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