xembly
xembly copied to clipboard
can't add an element/attribute with a namespace into Directives
At the moment adding an element/attribute with a namespace into Directives not implemented. I believe it has to be.
@yegor256 ~~could you suggest right now any workaround to add an attr with a namespace to an element using Directivies ?~~ I did it
@dmzaytsev what's wrong about just attr("xs:type", "string")
(for example)?
@yegor256 also I need add the namespace declaration to the root element.
I expect if I use attr("name", "string", "ns")
then Xembler should add the namespace declaration to the root element and generate a prefix for it.
I make Directivies in several places and then compile them into one xml, I have to remember about a namespace declarations.
@dmzaytsev than maybe it's better to add a validation. if you do attr("xs:type", "string")
, we will check whether this xs:
prefix is actually defined in the document. if not, you will get a runtime exception. make sense?
@yegor256 a validation is good idea. but let's imagine if I should generate a document
<doc xmlns:ns0="www.google.com/1">
<element1>
<ns0:element2/>
<ns0:element3/>
</element1>
</doc>
A developer made a Directivies with .add("ns0:element1")
in one class
and .add("ns2:element3")
in another class
I agree Xembly will report about indeclared ns2
, but how I should guess which namespace the developer meant when he/she used prefix ns2
?
@dmzaytsev got it, make sense, thanks
@dmzaytsev I am aware of the task, give me some time to find a developer...
@dmzaytsev many thanks, 15 mins added to your acc for reporting this bug, pmt ID 59134418
@0crat in
@0crat in (here)
@carlosmiranda Thanks for your contribution, @dmzaytsev/z! If you would be a member of the project, you would now earn +15 reputation points, as explained in §29. You can join and apply to it, see §2.
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
<doc xmlns:ns0="www.google.com/1">
<element1>
<ns0:element2/>
<ns0:element3/>
</element1>
</doc>
May be stored as
{
"doc": {
"-xmlns:ns0": "www.google.com/1",
"element1": {
"ns0:element2": {
"-self-closing": "true"
},
"ns0:element3": {
"-self-closing": "true"
}
}
},
"#omit-xml-declaration": "yes"
}
https://xmltojson.github.io/
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@carlosmiranda/z everybody who has role DEV
is banned at #66; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)
@dmzaytsev I'm closing this, since there will no fix