ID Validation

T

Tina

When creating a form based on a xml scheme, I want to have
an input field connected to a xml tag of the xs:ID type.
Infopath checks if that input field is filled in, because
it is of type ID. But I also want Infopath to check if one
ID is used two or more times in a form. but it does not
check this, so that I get an xml file, which when manualy
validated against the base scheme is not correct...Is this
a bug or is Infopath not responsible for checking uniqueness?
 
G

Guest

Hey, thanks for your support,

I tried to do it your way but somehow it does not work.
My XML looks something like
<step ID="">
<...>
</step>
<step ID="">
<...>
</step>

and so on. So I changed your proposal to
[ID] [is equal to] [../preceding-sibling::step/@ID]

But Infopath does not find an error if ID="A2" occurs two
or more times. Have I forgotten something?

Thanks
-----Original Message-----
It is possible. Here's one solution, though it won't solve
all issues, it will solve your current one:
I have a schema like this:

People
Person
ID
Name

[ID] [is equal to] [../preceding-sibling::person/ID]

The third drop-down uses a Formula. For the Screen Tip, I
just put "ID already exists, please choose another."
With this in place, if there is ever a repeat ID, it will
get marked with a red-dashed border and have the screen tip
to explain why. If the user corrects the duplicate on that
text box, the red border goes away. If the user corrects
the duplicate on the earlier text box, the red border fails
to go away. As I recall, there is a way to fix this too,
but I can't recall what it is.
 
Top