xml information contracting namespaces


i wish information contracting an xml request stock rudimentary form shows sum list people. i've got set adult operative right now:



<window x:class="databindingsample.window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
title="window1">
<window.resources>
<xmldataprovider x:key="xmlprovider" xpath="people" source="c:\someuri.xml"/>
</window.resources>
<grid>
<listbox name="personlist" itemssource="{binding source={staticresource xmlprovider}, xpath=person}">
<listbox.itemtemplate>
<datatemplate>
<textblock text="{binding xpath=name}" />
</datatemplate>
</listbox.itemtemplate>
</listbox>

<groupbox header="groupbox" name="groupbox1" datacontext="{binding elementname=personlist, path=selecteditem}">
<grid>
<textbox name="nametext" text="{binding xpath=name}"/>
<combobox name="gendercombo" text="{binding xpath=gender}">
<comboboxitem>male</comboboxitem>
<comboboxitem>female</comboboxitem>
</combobox>
</grid>
</groupbox>
</grid>
</window>


(all position/layout elements have private clarity)



now works great! i yield xml matches paths presumption i list names listbox arrangement both name gender suitable fields clicked. problem comes i start try namespaces xml source. xaml following changes feeling this:



<window x:class="databindingsample.window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
title="window1">
<window.resources>
<xmlnamespacemappingcollection x:key="namespacemappings">
<xmlnamespacemapping uri="http://www.mynamespace.com" prefix="mns"/>
</xmlnamespacemappingcollection>
<xmldataprovider x:key="xmlprovider" xmlnamespacemanager="{staticresource namespacemappings}" xpath="mns:people" source="c:\someuriwithnamespaces.xml"/>
</window.resources>
<grid>
<listbox name="personlist" itemssource="{binding source={staticresource xmlprovider}, xpath=mns:person}">
<listbox.itemtemplate>
<datatemplate>
<textblock text="{binding xpath=mns:name}" />
</datatemplate>
</listbox.itemtemplate>
</listbox>

<groupbox header="groupbox" name="groupbox1" datacontext="{binding elementname=personlist, path=selecteditem}">
<grid>
<textbox name="nametext" text="{binding xpath=mns:name}"/>
<combobox name="gendercombo" text="{binding xpath=mns:gender}">
<comboboxitem>male</comboboxitem>
<comboboxitem>female</comboboxitem>
</combobox>
</grid>
</groupbox>
</grid>
</window>


with formula (and graceful namespaced xml, course) listbox still displays names properly, nonetheless clicking those names longer updates name gender fields! guess somehow xml namespace reacting adversely groupbox's datacontext, nonetheless i'm certain since how. does anyone know xml namespaces context?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?