xembly icon indicating copy to clipboard operation
xembly copied to clipboard

can't add an element/attribute with a namespace into Directives

Open dmzaytsev opened this issue 9 years ago • 19 comments

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 avatar Jun 11 '15 08:06 dmzaytsev

@dmzaytsev what's wrong about just attr("xs:type", "string") (for example)?

yegor256 avatar Jun 12 '15 02:06 yegor256

@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 avatar Jun 12 '15 04:06 dmzaytsev

@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 avatar Jun 12 '15 05:06 yegor256

@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 avatar Jun 12 '15 05:06 dmzaytsev

@dmzaytsev got it, make sense, thanks

yegor256 avatar Jun 12 '15 16:06 yegor256

@dmzaytsev I am aware of the task, give me some time to find a developer...

davvd avatar Jun 15 '15 08:06 davvd

@dmzaytsev many thanks, 15 mins added to your acc for reporting this bug, pmt ID 59134418

davvd avatar Jun 15 '15 08:06 davvd

@0crat in

carlosmiranda avatar Aug 10 '18 06:08 carlosmiranda

@0crat in (here)

@carlosmiranda Job #66 is now in scope, role is DEV

0crat avatar Aug 10 '18 06:08 0crat

@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.

0crat avatar Aug 10 '18 06:08 0crat

@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)

0crat avatar Aug 10 '18 06:08 0crat

@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)

0crat avatar Aug 15 '18 07:08 0crat

@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)

0crat avatar Aug 20 '18 08:08 0crat

@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)

0crat avatar Aug 25 '18 10:08 0crat

@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)

0crat avatar Aug 30 '18 11:08 0crat

@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)

0crat avatar Sep 04 '18 11:09 0crat

@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)

0crat avatar Sep 09 '18 12:09 0crat

@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)

0crat avatar Sep 14 '18 13:09 0crat

@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)

0crat avatar Sep 19 '18 15:09 0crat

<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/

javadev avatar Nov 18 '22 23:11 javadev

@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)

0crat avatar Nov 20 '22 06:11 0crat

@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)

0crat avatar Nov 25 '22 07:11 0crat

@dmzaytsev I'm closing this, since there will no fix

yegor256 avatar Nov 25 '22 08:11 yegor256

@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)

0crat avatar Nov 30 '22 08:11 0crat