Add_Bddd
(Add Bddd)
April 22, 2022, 9:48am
1
Hello Guys,
Im trying to get Elements from my XML file, but i don
t know how to select it when i have namespaces like that:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ksx="http://www.w3.org/1999/XSL/Transform" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<xsl:output encoding="utf-8" indent="no" method="html"/>
<documents xmlns="http://www.w3.org">
So per online viewers my element tree is like that stylesheet->documents.
I have tried something like that - xmlDoc.Element(“stylesheet”).Element(“documents”).Elements(…). Obviously its not working i cannot select first two elements. I believe it
s due name spacing used. Could you help me here please?
Add_Bddd
(Add Bddd)
April 22, 2022, 10:11am
3
Hello Peter,
Thank you i have followed the guide, but i have got error:
For Each: The ‘:’ character, hexadecimal value 0x3A, cannot be included in a name.
namespace1=XSLT Namespace
doc.Element(namespace1+“stylesheet”)
Could you assist please?
ppr
(Peter Preuss)
April 22, 2022, 10:13am
4
please share the xml as file with us. thanks
also check on how the initial check can be done within the immediate panel. Please do it for the root and let us know the result
Add_Bddd
(Add Bddd)
April 22, 2022, 10:20am
5
I had to put brackets in namespace1={XSLT Namespace } - now it is working. Thank you Peter!
ppr
(Peter Preuss)
April 22, 2022, 10:23am
6
its not recommended as it looks like namespace1 variable was used as of dtatype string but is needed as of datatype: XNamespace
system
(system)
Closed
April 25, 2022, 10:24am
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.