I'm trying to use Xquery to extract specific info from XML tags but I can't get it to work, all I get is a NULL result. I don't know if the problem is with how the source XML is formed or my xquery statement.
My statement is,
DECLARE @xml xml
SELECT @xml = PasswordPolicy FROM role
SELECT
ppd.value('PasswordLengthMin[1]','int')
FROM @xml.nodes('//PasswordPolicy') pp(ppd)
The xml being populated into @xml is,
<PasswordPolicy xmlns:xsi=" xmlns:xsd="<PasswordLengthMin xmlns="urn:travelex.global.enterprise.service">7</PasswordLengthMin>
<PasswordLengthMax xmlns="urn:travelex.global.enterprise.service">50</PasswordLengthMax>
</PasswordPolicy>
If someone can help me out, thanks.
My statement is,
DECLARE @xml xml
SELECT @xml = PasswordPolicy FROM role
SELECT
ppd.value('PasswordLengthMin[1]','int')
FROM @xml.nodes('//PasswordPolicy') pp(ppd)
The xml being populated into @xml is,
<PasswordPolicy xmlns:xsi=" xmlns:xsd="<PasswordLengthMin xmlns="urn:travelex.global.enterprise.service">7</PasswordLengthMin>
<PasswordLengthMax xmlns="urn:travelex.global.enterprise.service">50</PasswordLengthMax>
</PasswordPolicy>
If someone can help me out, thanks.