Skip to content

Removing the namespace leaves {} prefix #289

Open
@tacman

Description

@tacman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions