Skip to content

XML conversion of array format #123

@djxhhh

Description

@djxhhh

hello When I used this package for XML conversion, I found that it could only retrieve or set one value for array data, not all values, when using paths to get or set values. Has this been optimized?
Similar to this:
type key struct {
name string
position int
isArray bool
isWildcard bool // Added wildcard identifier
}
// Handling wildcard cases
if p[0] == "*" {
newkey.isWildcard = true
newkey.isArray = true
ret = append(ret, newkey)
continue
}

// Handled full array retrieval
if strings.HasSuffix(keys[i], "[]") {
newkey.isWildcard = true
newkey.isArray = true
ret = append(ret, newkey)
continue
}
if keys[i].isWildcard {
// Iterate through the entire array
for idx := range vals {
// Process each element
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions