XDocument.View.SelectNodes results in error!!!

D

Daniel Huser

I have a form that is divided into multiple sections.
One of the sections includes a "Code Preserve" block.

As I do the insert of that section via button, I end up in the wrong
context, which means I have to do a XDocument.View.SelectNodes in order
to get into the context of that specific section.

Before I added the Code Preserve Block inside it, it worked all.
I was able to select/insert the block (Section) doing the following:

var node = XDocument.DOM.selectSingleNode("//s0:AblaufschrittBE");
if( existingAblaufschrittNode != null)
{
XDocument.View.SelectNodes(node);
XDocument.View.ExecuteAction("xCollection::insertBefore",
"AblaufschrittBE_1");
}
else
{
XDocument.View.ExecuteAction("xCollection::insert",
"AblaufschrittBE_1");
}


This worked just fine to insert another "AblaufschrittBE" section.

Now since I added a Code Preserve Block somewhere inside the
AblaufschrittBE structure, the call to XDocument.View.SelectNodes
results in the following error:

"Either the combination of values for the View.SelectNodes call is an
invalid selection, or the values are not defined for this view, defined
for this view more than once, or not selectable in the view."


I don't know if that all happens because of the Code Preserve part as
that was a bigger change, but it seems to be related to that or one of
the dependant changes.

In the manifest I have the following definition for that section to insert:

<xsf:xmlToEdit name="AblaufschrittBE_1"
item="/dfs:myFields/dfs:dataFields/s0:GetGeschaeftByIDResponse/s0:GetGeschaeftByIDResult/s0:Ablaufschritte/s0:AblaufschrittBE"

container="/dfs:myFields/dfs:dataFields/s0:GetGeschaeftByIDResponse/s0:GetGeschaeftByIDResult">
<xsf:editWith caption="AblaufschrittBE" xd:autogeneration="template"
component="xCollection">
<xsf:fragmentToInsert>
<xsf:chooseFragment innerFragment="s0:Ablaufschritte/s0:AblaufschrittBE">
<s0:Ablaufschritte> <s0:AblaufschrittBE>
<s0:AblaufschrittID>00000000-0000-0000-0000-000000000000</s0:AblaufschrittID>
<s0:GeschaeftID>00000000-0000-0000-0000-000000000000</s0:GeschaeftID>
<s0:provisorisch>false</s0:provisorisch>
<s0:Datum></s0:Datum>
<s0:AblaufschrittTypID></s0:AblaufschrittTypID>
<s0:AblaufschrittTypName></s0:AblaufschrittTypName>
<s0:SitzungsDatum></s0:SitzungsDatum>
<s0:SitzungsNr></s0:SitzungsNr>
<s0:BeschlussNrGR></s0:BeschlussNrGR>
<s0:BeschlussNrSR></s0:BeschlussNrSR>
<s0:FristBis></s0:FristBis>
<s0:pendentBei></s0:pendentBei>
<s0:protokollEintrag></s0:protokollEintrag>
<s0:Akteure>
<s0:AblaufschrittAkteurBE>

.......lots of stuff in here......

</s0:AblaufschrittAkteurBE>
</s0:Akteure>
<s0:GewaehlterAkteurTypID xsi:nil="true"></s0:GewaehlterAkteurTypID>
<s0:GewaehlterAkteurGuid xsi:nil="true"></s0:GewaehlterAkteurGuid>
</s0:AblaufschrittBE> </s0:Ablaufschritte>
</xsf:chooseFragment>
</xsf:fragmentToInsert>
</xsf:editWith>
</xsf:xmlToEdit>


The "AblaufschrittTypID" part is inside a Code Preserve block in the XSL.

The strange thing is, that if I make the select directly to the field
"//s0:AblaufschrittBE/s0:Akteure/s0:AblaufschrittAkteurBE " it doesn't
result in an error. This is rather strange......

Any ideas? I haven't found anything about this error on the net!

Would GREATLY appreciate help on this one!!!!!

Regards,
Daniel
 
S

Steve van Dongen [MSFT]

I have a form that is divided into multiple sections.
One of the sections includes a "Code Preserve" block.

As I do the insert of that section via button, I end up in the wrong
context, which means I have to do a XDocument.View.SelectNodes in order
to get into the context of that specific section.

Before I added the Code Preserve Block inside it, it worked all.
I was able to select/insert the block (Section) doing the following:

var node = XDocument.DOM.selectSingleNode("//s0:AblaufschrittBE");
if( existingAblaufschrittNode != null)
{
XDocument.View.SelectNodes(node);
XDocument.View.ExecuteAction("xCollection::insertBefore",
"AblaufschrittBE_1");
}
else
{
XDocument.View.ExecuteAction("xCollection::insert",
"AblaufschrittBE_1");
}


This worked just fine to insert another "AblaufschrittBE" section.

Now since I added a Code Preserve Block somewhere inside the
AblaufschrittBE structure, the call to XDocument.View.SelectNodes
results in the following error:

"Either the combination of values for the View.SelectNodes call is an
invalid selection, or the values are not defined for this view, defined
for this view more than once, or not selectable in the view."


I don't know if that all happens because of the Code Preserve part as
that was a bigger change, but it seems to be related to that or one of
the dependant changes.

In the manifest I have the following definition for that section to insert:

<xsf:xmlToEdit name="AblaufschrittBE_1"
item="/dfs:myFields/dfs:dataFields/s0:GetGeschaeftByIDResponse/s0:GetGeschaeftByIDResult/s0:Ablaufschritte/s0:AblaufschrittBE"

container="/dfs:myFields/dfs:dataFields/s0:GetGeschaeftByIDResponse/s0:GetGeschaeftByIDResult">
<xsf:editWith caption="AblaufschrittBE" xd:autogeneration="template"
component="xCollection">
<xsf:fragmentToInsert>
<xsf:chooseFragment innerFragment="s0:Ablaufschritte/s0:AblaufschrittBE">
<s0:Ablaufschritte> <s0:AblaufschrittBE>
<s0:AblaufschrittID>00000000-0000-0000-0000-000000000000</s0:AblaufschrittID>
<s0:GeschaeftID>00000000-0000-0000-0000-000000000000</s0:GeschaeftID>
<s0:provisorisch>false</s0:provisorisch>
<s0:Datum></s0:Datum>
<s0:AblaufschrittTypID></s0:AblaufschrittTypID>
<s0:AblaufschrittTypName></s0:AblaufschrittTypName>
<s0:SitzungsDatum></s0:SitzungsDatum>
<s0:SitzungsNr></s0:SitzungsNr>
<s0:BeschlussNrGR></s0:BeschlussNrGR>
<s0:BeschlussNrSR></s0:BeschlussNrSR>
<s0:FristBis></s0:FristBis>
<s0:pendentBei></s0:pendentBei>
<s0:protokollEintrag></s0:protokollEintrag>
<s0:Akteure>
<s0:AblaufschrittAkteurBE>

.......lots of stuff in here......

</s0:AblaufschrittAkteurBE>
</s0:Akteure>
<s0:GewaehlterAkteurTypID xsi:nil="true"></s0:GewaehlterAkteurTypID>
<s0:GewaehlterAkteurGuid xsi:nil="true"></s0:GewaehlterAkteurGuid>
</s0:AblaufschrittBE> </s0:Ablaufschritte>
</xsf:chooseFragment>
</xsf:fragmentToInsert>
</xsf:editWith>
</xsf:xmlToEdit>


The "AblaufschrittTypID" part is inside a Code Preserve block in the XSL.

The strange thing is, that if I make the select directly to the field
"//s0:AblaufschrittBE/s0:Akteure/s0:AblaufschrittAkteurBE " it doesn't
result in an error. This is rather strange......

Any ideas? I haven't found anything about this error on the net!

Would GREATLY appreciate help on this one!!!!!

What does the XSL look like? It wouldn't happen to have the preserve
code block immediately inside the xsl-foreach, would it? i.e.
<xsl:for-each select="s0:AblaufschrittBE">
<xsl:appy-templates ... mode="xd:preserve" />

Regards,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top