Looking for old forum posts and information? View the old forum archive here ยป
Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

A static copy of our previous forums website is available online for reference. Click here to access the forum archive.

Learn more about...

AspDotNetStorefront
DotFeed

GetMLValue?

By debugging in an XML package, I know that an in-page SQL query that I created is returning the parameter ("MyNewParameter") that I want. However, when I try to display the value of the parameter using the aspdnsf:GetMLValue method:

<xsl:value-of select="aspdnsf:GetMLValue(MyNewParameter)" disable-output-escaping="yes" />

it doesn't display anything.

The page works fine, I know the value is getting passed back from the database, but I can't figure out why this won't display it. I have used this method in the same package for several other new parameters and they all display like a charm.

asked Mar 7 in MultiStore by jcarswell (180 points)

1 Answer

+1 vote
 
Best answer
GetMLValue will return an empty string if the value passed into it was invalid XML, or if there isn't any localized text for the requested locale (the default locale, if you didn't specify one in the call).
answered Mar 8 by Vortx ScottS (11,270 points)
selected Mar 8 by jcarswell

Here's the XML that gets returned:

<Customer>
    <DefaultLocationID>
      <P21_Def_Loc_ID>21</P21_Def_Loc_ID>
    </DefaultLocationID>
  </Customer>

Looks valid to me(?). If it's a locale issue, how do I "localize" this now?

Just to clarify, here's the actual code I'm trying to string into the page:

<xsl:value-of select="aspdnsf:GetMLValue(P21_Def_Loc_ID)" disable-output-escaping="yes" />

 

I've also noticed the following error is being logged for this page:

The 'meta' start tag on line 2 position 6 does not match the end tag of 'span'. Line 2, position 102.

Not sure if this is related?

 

That's valid XML, but not for GetMLValue.  That method's only used to get the localized version of text out of what ASPDNSF calls ML-encoded data...something along the lines of:

<ml><locale name="en-US">English words</locale><locale name="fr-FR">French version</locale></ml>

If you're just trying to get a value out of some XML, XPATH is the way to go.

Xpath was the trick, thanks!
...