Lello1964 Well-Known Member Licensed User Longtime User May 31, 2023 #1 I have this code : B4X: Dim x As XMLBuilder x = x.create("p:Test1") x = x.element("p:Test2") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") _ .up() _ .up() _ .element("JetS3t") Dim props As Map props.Initialize 'props.Put("omit-xml-declaration", "yes") props.Put("{http://xml.apache.org/xslt}indent-amount", "4") props.Put("indent", "yes") Log(x.asString2(props)) this is xml: <?xml version="1.0" encoding="UTF-8"?><p:Test1> <p:Test2 xmlns:ds="xxxx#" xmlns="yyyy" xmlns:xsi="zzzzzz"> <rrrrrr/> </p:Test2> <JetS3t/> </p:Test1> i want this : <?xml version="1.0" encoding="UTF-8"?> <p:Test1 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz> <p:Test2 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz"> <rrrrrr/> </p:Test2> <JetS3t/> </p:Test1> how set : <p:Test1 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz>
I have this code : B4X: Dim x As XMLBuilder x = x.create("p:Test1") x = x.element("p:Test2") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") _ .up() _ .up() _ .element("JetS3t") Dim props As Map props.Initialize 'props.Put("omit-xml-declaration", "yes") props.Put("{http://xml.apache.org/xslt}indent-amount", "4") props.Put("indent", "yes") Log(x.asString2(props)) this is xml: <?xml version="1.0" encoding="UTF-8"?><p:Test1> <p:Test2 xmlns:ds="xxxx#" xmlns="yyyy" xmlns:xsi="zzzzzz"> <rrrrrr/> </p:Test2> <JetS3t/> </p:Test1> i want this : <?xml version="1.0" encoding="UTF-8"?> <p:Test1 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz> <p:Test2 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz"> <rrrrrr/> </p:Test2> <JetS3t/> </p:Test1> how set : <p:Test1 xmlns:ds="xxxx" xmlns="yyyy" xmlns:xsi="zzzzzz>
Daestrum Expert Licensed User Longtime User May 31, 2023 #2 Maybe B4X: x = x.create("p:Test1") x = x.element("p:Test2") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") ... as B4X: x = x.create("p:Test1") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") ... Upvote 0
Maybe B4X: x = x.create("p:Test1") x = x.element("p:Test2") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") ... as B4X: x = x.create("p:Test1") _ .attribute("xmlns:ds", "xxxx#") _ .attribute("xmlns:p", "yyyy") _ .attribute("xmlns:xsi", "zzzzzz") _ .element("rrrrrr") ...
Lello1964 Well-Known Member Licensed User Longtime User May 31, 2023 #3 Solved, thank Last edited: May 31, 2023 Upvote 0