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

Syntax for getting a pair of a tag attribute and value simultaneously #1

Open
Kryomancer opened this issue Feb 28, 2023 · 2 comments
Open

Comments

@Kryomancer
Copy link

Kryomancer commented Feb 28, 2023

I have an XML file with numerous entries like so:

<q_code qc_type="skip">4-7-1</q_code>
<q_code qc_type="sh_desc">0a7.14</q_code>
<q_code qc_type="four_corner">1010.6</q_code>
<q_code qc_type="deroo">3273</q_code>
<q_code>200</q_code>

For the death of me, I cannot come up with the correct syntax to aqcuire a List<Pair<String,String>> where one string is the attribute and another the value inside the tag. If I write something like list("q_code") then anything after it expects a child element and the attribute is lost and the list function does not appear to accept pairs. If this isn't possible, are there any other ways one might aqcuire both for an arbitrary number of these tags in some other usable format? Be aware that not all of these tags have the attribute and the relation between the attribute and the value is important, so something that returns a list of all the attribute values without the nulls in would not work. This is nested inside other tags that I can handle writing the code for, in case this matters.

@asm0dey
Copy link
Owner

asm0dey commented Jun 6, 2023

Hm, it seems that I didn't think about such a matcher :(

@asm0dey
Copy link
Owner

asm0dey commented Jun 6, 2023

But probably it might be solved by writing a custom handler! A handler that will return both the value of the argument and the text inside the tag!

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

2 participants