• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Testing with &

paul.timm

New member
I'm an art guy so please pardon me if this is a really obvious thing.

I'm working on stats and need to run a text to find all Character cards with a Cost Type of E and average the number in the associate cost group.

<stat id="charavge" name="Avg E cost Char" scope="deck1" visibility="always">
<test> type.Char? & CostType.E </test>
<calc> avg:cost.? </calc>
</stat>

I keep running into an "unrecognized special token" error based on the &, but I can't see any other way to do it.
 
Testing with &

This is an XML syntax issue. The '&' character is reserved as a special character within XML, so you can't use it directly. There are two ways to solve this. The first approach is to use the "escape code" for the '&', which is the string "&". The second is to put the entire contents of the "<test>" element within a "CDATA" block.

With the first approach, the element would become:
<test> type.Char? & CostType.E </test>

With the second approach, the element would become:
<test><![CDATA[ type.Char? & CostType.E ]]></test>

Both of these approaches are identified in the "Fundamentals" chapter of the Authoring Kit documentation if you want further details. You'll find an indepth discussion of these approaches in any reference on XML itself.

Hope this helps,
Rob


At 12:40 PM 7/9/2006, you wrote:

I'm an art guy so please pardon me if this is a really obvious thing.

I'm working on stats and need to run a text to find all Character cards with a cost type of E and average that cost.

<stat id="charavge" name="Avg E cost Char" scope="deck1" visibility="always">
<test> type.Char? & CostType.E </test>
<calc> avg:cost.? </calc>
</stat>

I keep running into errors based on the &, but I can't see any other way to do it.
 
Back
Top