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

How do I synthesize an xml object that has both attributes and values? #101

Open
Crazyokd opened this issue Sep 26, 2024 · 0 comments
Open

Comments

@Crazyokd
Copy link

with below code:

local people = {
    command_code="Authentication-Information-Request",
    applicationId="3GPP S6a/S6d",
    ["Hop-by-Hop"] = "0x5dd1330b",
    avp = {
        ["Session-Id"] = {
            _attr = {type = "string", vendor = "0"},
        },
    }
}
print("XML Representation\n")
print(xml2lua.toXml(people, "root"))

I can get below result:

XML Representation

<root>
  <Hop-by-Hop>0x5dd1330b</Hop-by-Hop>
  <command_code>Authentication-Information-Request</command_code>
  <applicationId>3GPP S6a/S6d</applicationId>
  <avp>
    <Session-Id>dfslk</Session-Id>
    <Session-Id>
      <vendor>0</vendor>
      <type>string</type>
    </Session-Id>
  </avp>
</root>

But I want synthesize <Session-Id type="string" vendor="0">846</Session-Id>
i tried various method, but all can't work.

ppebb added a commit to ppebb/solution-nvim that referenced this issue Nov 28, 2024
Two functions are now available, add_nuget_dep and add_local_dep. This
commit also includes the removal of BOM characters from the beginning of
projects to avoid breaking xml2lua (see
manoelcampos/xml2lua#101).

Associated removal functions will be added later. add_project_dep will
also be added later.
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