Search Results

Search found 803 results on 33 pages for 'xpath'.

Page 19/33 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How do I perform this XPath query with Linq?

    - by John Hansen
    In the following code I am using XPath to find all of the matching nodes using XPath, and appending the values to a StringBuilder. StringBuilder sb = new StringBuilder(); foreach (XmlNode node in this.Data.SelectNodes("ID/item[@id=200]/DAT[1]/line[position()>1]/data[1]/text()")) { sb.Append(node.Value); } return sb.ToString(); How do I do the same thing, except using Linq to XML instead? Assume that in the new version, this.Data is an XElement object.

    Read the article

  • Can I get an XPathNodeIterator directly from an XPath?

    - by Val
    I hope I'm just missing something obvious. I have a number of repeating nodes in an XML document: <root> <parent> <child/> <child/> </parent> </root> I need to examine the contents of each of the <child> elements in turn, so I need an XPathNodeIterator containing the nodeset of all the <child> nodes. If I have an XPath that would select the child nodes, e.g. /root/parent/child, is there any way to feed that directly to a new XPathNodeIterator? Everything I see in the docs and examples indicates I have to first get an XPathNavigator to the <parent>, then Select the child nodes, like: XPathNavigator nav = datasource.CreateNavigator().SelectSingleNode( "/root/parent" ); XPathNodeIterator it = nav.Select( "./child" ); foreach ( child in it ) { /* do something */ } I was hoping to skip the XPathNavigator, and intialize the XPathNodeIterator with XPath to the child nodes directly, something like: XpathNodeIterator it = new XpathNodeIterator("/root/parent/child"); foreach ( child in it ) { /* do something */ } Possible? The benefit is not only saving a line of code, but I can use a single XPath expression, rather than splitting the path to the <child> nodes in two, first to get the parent element, then to select its children.

    Read the article

  • WPF - List View Row Index and Validation

    - by abhishek
    Hi, I have a ListView with TextBoxes in second column. I want to validate that my text box does not contain a number if the third column(data_type) is "Text". I am unable to do the validation. I tried a few approaches. In one approach I try to handle the MouseDown event and am trying to get the Row number so that I can get the data_type value of that row. I want to us this value in the Validate method. I have been struggling for a week now. Would appreciate if anybody could help. <ControlTemplate x:Key="validationTemplate"> <DockPanel> <TextBlock Foreground="Red" FontSize="20">!</TextBlock> <AdornedElementPlaceholder/> </DockPanel> </ControlTemplate> <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style> <DataTemplate x:Key="textTemplate"> <TextBox HorizontalAlignment= "Stretch" IsEnabled="{Binding XPath=./@isenabled}" Validation.ErrorTemplate="{StaticResource validationTemplate}" Style="{StaticResource textBoxInError}"> <TextBox.Text> <Binding XPath="./@value" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <local:TextBoxMinMaxValidation> <local:TextBoxMinMaxValidation.DataType> <local:DataTypeCheck Datatype="{Binding Source={StaticResource dataProvider}, XPath='/[@id=CustomerServiceQueueName]'}"/> </local:TextBoxMinMaxValidation.DataType> <local:TextBoxMinMaxValidation.ValidRange> <local:Int32RangeChecker Minimum="{Binding Source={StaticResource dataProvider}, XPath=./@min}" Maximum="{Binding Source={StaticResource dataProvider}, XPath=./@max}"/> </local:TextBoxMinMaxValidation.ValidRange> </local:TextBoxMinMaxValidation> </Binding.ValidationRules> </Binding > </TextBox.Text> </TextBox> </DataTemplate> <DataTemplate x:Key="dropDownTemplate"> <ComboBox Name="cmbBox" HorizontalAlignment="Stretch" SelectedIndex="{Binding XPath=./@value}" ItemsSource="{Binding XPath=.//OPTION/@value}" IsEnabled="{Binding XPath=./@isenabled}" /> </DataTemplate> <DataTemplate x:Key="booldropDownTemplate"> <ComboBox Name="cmbBox" HorizontalAlignment="Stretch" SelectedIndex="{Binding XPath=./@value, Converter={StaticResource boolconvert}}"> <ComboBoxItem>True</ComboBoxItem> <ComboBoxItem>False</ComboBoxItem> </ComboBox> </DataTemplate> <local:ControlTemplateSelector x:Key="myControlTemplateSelector"/> <Style x:Key="StretchedContainerStyle" TargetType="{x:Type ListViewItem}"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="Template" Value="{DynamicResource ListBoxItemControlTemplate1}"/> </Style> <ControlTemplate x:Key="ListBoxItemControlTemplate1" TargetType="{x:Type ListBoxItem}"> <Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" Padding="{TemplateBinding Padding}" BorderThickness="0,0.5,0,0.5"> <GridViewRowPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Border> </ControlTemplate> <Style x:Key="CustomHeaderStyle" TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Background" Value="LightGray" /> <Setter Property="FontWeight" Value="Bold"/> <Setter Property="FontFamily" Value="Arial"/> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="Padding" Value="2,0,2,0"/> </Style> </UserControl.Resources> <Grid x:Name="GridViewControl" Height="Auto"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="34"/> </Grid.RowDefinitions> <ListView x:Name="ListViewControl" Grid.Row="0" ItemContainerStyle="{DynamicResource StretchedContainerStyle}" ItemTemplateSelector="{DynamicResource myControlTemplateSelector}" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource dataProvider}, XPath=//CONFIGURATION}"> <ListView.View > <GridView > <GridViewColumn Header="ID" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@id}"/> <GridViewColumn Header="VALUE" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" CellTemplateSelector="{DynamicResource myControlTemplateSelector}" /> <GridViewColumn Header="DATATYPE" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@data_type}"/> <GridViewColumn Header="DESCRIPTION" HeaderContainerStyle="{StaticResource CustomHeaderStyle}" DisplayMemberBinding="{Binding XPath=./@description}" Width="{Binding ElementName=ListViewControl, Path=ActualWidth}"/> </GridView> </ListView.View> </ListView> <StackPanel Grid.Row="1"> <Button Grid.Row="1" HorizontalAlignment="Stretch" Height="34" HorizontalContentAlignment="Stretch" > <StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Orientation="Horizontal" FlowDirection="RightToLeft" Height="30"> <Button Grid.Row="1" Content ="Apply" Padding="0,0,0,0 " Margin="6,2,0,2" Name="btn_Apply" HorizontalAlignment="Right" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="132" IsTabStop="True" Click="btn_ApplyClick" Height="24" /> </StackPanel > </Button> </StackPanel > </Grid>

    Read the article

  • How Can i click on this element using XPATH in Web driver?

    - by Mike
    Here is the html..... <li> <input type="checkbox" checked="" name="selectedMstrPrivGroupList[9].mstrAuthorities[0].status"/> Add Dexter </li> How will I be able to click on this element. It is a check box. And I want to use XPath as I have close to 30+ checkboxes in the page, so that I can create a generic method and pass only the Webelement.. I tried the following but didn't work. Driver.findElement(By.xpath("//input[contains(.,'Add Dexter')]")).click(); Please help!! Thanks, Mike

    Read the article

  • Xpath problem, getting the id(attribute) of a element, if you know the title of the element.

    - by user577823
    Hi guys, My question is, is it possible to get the Article ID, when you have the title of the article?(via xpath) Articles Article ID="1" title crack /title content blablabalbal /content /Article /Articles Because i am using this right now, it isnt working though. $xml = simplexml_load_file("Articles.xml"); $XElement = new SimpleXMLElement($xml-asXML()); $Articles = $XElement-xpath("Article"); $title = "crack"; $elements = count($Articles); for($i = 0; $i title; if($Titles == $title) //This is not working? i dont know why? { $AID = (string)$Articles[$i][@"ID"]; } }

    Read the article

  • Alternative, more efficient scraping method for a noncoder, than Google doc's importxml and xpath?

    - by binarybunny
    I've searched throughout the net for a simple solution, but it seems everyone has their own unique method (coding language) of achieving this. I'm only just beginning to learn Linux, and my coding skills are thoroughly lacking (non-existent). I love the simplicity of using importxml and xpath, but copying and pasting values after reaching the spreadsheet limit of 50 is getting old. Now that I've seen the light, I would really just like to know of a simple, yet scalable solution to get more data into more spreadsheets/databases. Before I really start getting my hands dirty, I would love to know some of the ways you guys go about accomplishing this?

    Read the article

  • How to concatenate the contents of all children of a node in XPath?

    - by Brian
    Is it possible with XPath to get a concatenated view of all of the children of a node? I am looking for something like the JQuery .html() method. For example, if I have the following XML: <h3 class="title"> <span class="content">this</span> <span class="content"> is</span> <span class="content"> some</span> <span class="content"> text</span> </h3> I would like an XPath query on "h3[@class='title']" that would give me "this is some text". That is the real question, but if more context/background is helpful, here it is: I am using XPath and I used this post to help me write some complex XSL. My source XML looks like this. <h3 class="title">Title</h3> <p> <span class="content">Some</span> <span class="content"> text</span> <span class="content"> for</span> <span class="content"> this</span> <span class="content"> section</span> </p> <p> <span class="content">Another</span> <span class="content"> paragraph</span> </p> <h3 class="title"> <span class="content">Title</span> <span class="content"> 2</span> <span class="content"> is</span> <span class="content"> complex</span> </h3> <p> <span class="content">Here</span> <span class="content"> is</span> <span class="content"> some</span> <span class="content"> text</span> </p> My output XML considers each <h3> as well as all <p> tags until the next <h3>. I wrote the XSL as follows: <xsl:template match="h3[@class='title']"> ... <xsl:apply-templates select="following-sibling::p[ generate-id(preceding-sibling::h3[1][@class='title'][text()=current()/text()]) = generate-id(current()) ]"/> ... </xsl:template> The problem is that I use the text() method to identify h3s that are the same. In the example above, the "Title 2 is complex" title's text() method returns whitespace. My thought was to use a method like JQuery's .html that would return me "Title 2 is complex"

    Read the article

  • Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax?

    - by Greg
    Hi, Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax? ie. really looking for simple but flexible way to persist a graph of object data (e.g. have say 2 or 3 classes with associations) - if Linq-to-xml were as simple as saying "persist this graph to XML", and then you could also query it via Linq, or load it into memory again/change/then re-save to the xml file.

    Read the article

  • How can I fix "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the conte

    - by slolife
    I have a user control (ascx) that I have added two public properties to: RequestTypeId and GroupId. Both have the attribute set. In my aspx page, I have a ListView, and in the ItemTemplate, I place my control reference, like so: <ctrl:ServiceTypeGroup runat="server" RequestTypeId="<%#RequestType.RequestTypeId%>" GroupId='<%#Eval("Id").ToString()%>' /> Setting the RequestTypeId works fine. Setting the GroupId fails with the following error: "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control." What do I need to do to my user control code to allow binding a Eval() expression to one of its properties? Or is it not possible?

    Read the article

  • Howto add a changed file to an older (not last) commit in Git

    - by David Klein
    Hey, I changed several things over the last hour and committed them step by step. But I just realized I've forgot to add a changed file some commits ago. The Log looks like this: GIT TidyUpRequests u:1 d:0> git log commit fc6734b6351f6c36a587dba6dbd9d5efa30c09ce Author: David Klein <> Date: Tue Apr 27 09:43:55 2010 +0200 The Main program now tests both Webservices at once commit 8a2c6014c2b035e37aebd310a6393a1ecb39f463 Author: David Klein <> Date: Tue Apr 27 09:43:27 2010 +0200 ISBNDBQueryHandler now uses the XPath functions from XPath.fs too commit 06a504e277fd98d97eed4dad22dfa5933d81451f Author: David Klein <> Date: Tue Apr 27 09:30:34 2010 +0200 AmazonQueryHandler now uses the XPath Helper functions defined in XPath.fs commit a0865e28be35a3011d0b6091819ec32922dd2dd8 <--- changed file should go here Author: David Klein <> Date: Tue Apr 27 09:29:53 2010 +0200 Factored out some common XPath Operations Any ideas? :)

    Read the article

  • Extending DOMDocument and DOMNode: problem with return object

    - by Glauber Rocha
    I'm trying to extend the DOMDocument class so as to make XPath selections easier. I wrote this piece of code: class myDOMDocument extends DOMDocument { function selectNodes($xpath){ $oxpath = new DOMXPath($this); return $oxpath->query($xpath); } function selectSingleNode($xpath){ return $this->selectNodes($xpath)->item(0); } } These methods return a DOMNodeList and a DOMNode object, respectively. What I'd like to do now is to implement similar methods to the DOMNode objects. But obviously if I write a class (myDOMNode) that extends DOMNode, I won't be able to use these two extra methods on the nodes returned by myDOMDocument because they're DOMNode (and not myDOMNode) objects. I'm rather a beginner in object programming, I've tried various ideas but they all lead to a dead-end. Any hints? Thanks a lot in advance.

    Read the article

  • Python lxml - returns null list

    - by Chris Finlayson
    I cannot figure out what is wrong with the XPATH when trying to extract a value from a webpage table. The method seems correct as I can extract the page title and other attributes, but I cannot extract the third value, it always returns an empty list? from lxml import html import requests test_url = 'SC312226' page = ('https://www.opencompany.co.uk/company/'+test_url) print 'Now searching URL: '+page data = requests.get(page) tree = html.fromstring(data.text) print tree.xpath('//title/text()') # Get page title print tree.xpath('//a/@href') # Get href attribute of all links print tree.xpath('//*[@id="financial"]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[1]/div[2]/text()') Unless i'm missing something, it would appear the XPATH is correct: Chrome screenshot I checked Chrome console, appears ok! So i'm at a loss $x ('//*[@id="financial"]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[1]/div[2]/text()') [ "£432,272" ]

    Read the article

  • Html Agility Pack for Reading “Real World” HTML

    - by WeigeltRo
    In an ideal world, all data you need from the web would be available via well-designed services. In the real world you sometimes have to scrape the data off a web page. Ugly, dirty – but if you really want that data, you have no choice. Just don’t write (yet another) HTML parser. I stumbled across the Html Agility Pack (HAP) a long time ago, but just now had the need for a robust way to read HTML. A quote from the website: This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams). Using the HAP was a simple matter of getting the Nuget package, taking a look at the example and dusting off some of my XPath knowledge from years ago. The documentation on the Codeplex site is non-existing, but if you’ve queried a DOM or used XPath or XSLT before you shouldn’t have problems finding your way around using Intellisense (ReSharper tip: Press Ctrl+Shift+F1 on class members for reading the full doc comments).

    Read the article

  • In XSLT is it possible to use the value of an xpath expression in a call to a template using an par

    - by Cell
    I am performing an xsl transform and in it I call a template with a param using the following code <xsl:call-template name="GenerateColumns"> <xsl:with-param name="curRow" select="$curRow"/> <xsl:with-param name="curCol" select="$curCol + 1"/> </xsl:call-template> This calls a template function which outputs part of a table element in HTML. The curRow and curCol are used to determine which row and column we are in the table. gbl_maxCols is set to the number of columns in an html table <xsl:template name="GenerateColumns"> <xsl:when test="$curCol &lt;= $gbl_maxCols"> <td> <xsl:attribute="colspan"> <xsl:value-of select="/page/column/@skipColumns"/> </xsl:attribute> </xsl:when> </xsl:template> The result of this function is a set of td elements, however some of these elements (those with a skipColumn attribute greater than 1 span more than 1 column, I need to skip this many columns with the next call to generateColumns. this works just like I would expect in the case where I simply increment the curCol param but I have a case where I need to use the value from the xml attribute skipColumns in the math to calculate the value for curCol. In the above case I iterate through all the columns and this works for the majority of my use cases. However in same cases I need to skip over some of the columns and need to pass in that value from the xml attribute to calculate how many columns I need to skip. My naive first attempt was something like this <xsl:call-template name="GenerateColumns"> <xsl:with-param name="curRow" select="$curRow"/> <xsl:with-param name="curCol" select="$curCol + /page/column/@skipColumns"/> </xsl:call-template> But unforutnately this does not seem to work. Is there any way to use an attribute from an xml page in the calculation for the value of a param in xsl. My xml page is something like this (edited heavily since the xml file is rather large) <page> <column name="blank" skipColumns="1"/> <column name="blank" skipColumns="1"/> <column name="test" skipColumns="3"/> <column name="blank" skipColumns="1"/> <column name="test2" skipColumns="6"/> </page> after all of this I would like to have a set of td elements like the following <td></td><td></td><td colSpan="3"></td><td></td><td colSpan="6"></td> if I just iterate through the columns I instead end up with something like this which gives me more td elements than I should have <td></td><td></td><td colSpan="3"></td><td></td><td colSpan="6"></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td> Edited to provide more information

    Read the article

  • scrapy cannot find div on this website [on hold]

    - by Jaspal Singh Rathour
    I am very new at this and have been trying to get my head around my first selector can somebody help? i am trying to extract data from page http://groceries.asda.com/asda-webstore/landing/home.shtml?cmpid=ahc--ghs-d1--asdacom-dsk-_-hp#/shelf/1215337195041/1/so_false all the info under div class = listing clearfix shelfListing but i cant seem to figure out how to format response.xpath(). I have managed to launch scrapy console but no matter what I type in response.xpath() i cant seem to select the right node. I know it works because when I type response.xpath('//div[@class="container"]') I get a response but don't know how to navigate to the listsing cleardix shelflisting. I am hoping that once i get this bit I can continue working my way through the spider. Thank you in advance! PS I wonder if it is not possible to scan this site - is it possible for the owners to block spiders?

    Read the article

  • Scrapy cannot find div on this website [on hold]

    - by Jaspal Singh Rathour
    I am very new at this and have been trying to get my head around my first selector can somebody help? i am trying to extract data from page http://groceries.asda.com/asda-webstore/landing/home.shtml?cmpid=ahc--ghs-d1--asdacom-dsk-_-hp#/shelf/1215337195041/1/so_false all the info under div class = listing clearfix shelfListing but i cant seem to figure out how to format response.xpath(). I have managed to launch scrapy console but no matter what I type in response.xpath() i cant seem to select the right node. I know it works because when I type response.xpath('//div[@class="container"]') I get a response but don't know how to navigate to the listsing cleardix shelflisting. I am hoping that once i get this bit I can continue working my way through the spider. Thank you in advance! PS I wonder if it is not possible to scan this site - is it possible for the owners to block spiders?

    Read the article

  • Column Header for a WPF TreeView

    - by nareshbhatia
    I am using the WPF TreeView to display some hierarchical information. Each item in the TreeView consists of several attributes, so I am using a Grid within my HierarchicalDataTemplate to display these attributes: <HierarchicalDataTemplate x:Key="ArtistTemplate" ItemsSource="{Binding XPath=Title}" ItemTemplate="{StaticResource TitleTemplate}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition SharedSizeGroup="NameColumn" /> <ColumnDefinition SharedSizeGroup="GenreColumn" /> <ColumnDefinition SharedSizeGroup="BornColumn" /> <ColumnDefinition SharedSizeGroup="DiedColumn" /> </Grid.ColumnDefinitions> <TextBlock Grid.Column="0" Text="{Binding XPath=@Name}" /> <TextBlock Grid.Column="1" Text="{Binding XPath=@Genre}" /> <TextBlock Grid.Column="2" Text="{Binding XPath=@Born}" /> <TextBlock Grid.Column="3" Text="{Binding XPath=@Died}" /> </Grid> </HierarchicalDataTemplate> This displays as a nice TreeView with 4 columns - so far so good! The only additional thing I need is a header above the TreeView that displays column names. The header column widths should be synchronized with TreeViewItems and also the header styles should be customizable. What's the easiest way to do this? P.S. I found two solutions that came close: 1) A TreeListView here, but this requires me to implement a custom interface (ITreeModel) to my model. Also the approach in this solution is to start with a ListView and to implement a RowExpander manually. In my case, the TreeView is sufficiently close to what I need, so I am hoping that putting a header on it should be very simple. 2) A TreeListView here. This one indeed starts with a TreeView, but I can't figure out how to customize the header. I suspect that I have to customize the GridViewHeaderRowPresenter in the generic.xaml, but this element does not seem to have its own ControlTemplate.

    Read the article

  • help with grouping and sorting for TreeView in xaml

    - by danhotb
    I am having problems getting my head around grouping and sorting in xaml and hope someone can get me straightened out! I have creaed an xml file from a tree of files and folders (just like windows explorer) that can be serveral levels deep. I have bound a TreeView control to an xml datasource and it works great! It sorts everything alphabetically but ... I would like it to sort all folders first then all files, rather than folders listed with files, as it does now. the xml : if you load this to a treeviw it will display the two files before the folder because they are first in alpha-order. here is my code: <!-- This will contain the XML-data. --> <XmlDataProvider x:Key="xmlDP" XPath="*"> <x:XData> <Select_Project /> </x:XData> </XmlDataProvider> <!-- This HierarchicalDataTemplate will visualize all XML-nodes --> <HierarchicalDataTemplate DataType="project" ItemsSource ="{Binding}"> <TextBlock Text="{Binding XPath=@name}" /> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType="folder" ItemsSource ="{Binding}"> <TextBlock Text="{Binding XPath=@name}" /> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType="file" ItemsSource ="{Binding}"> <TextBlock Text="{Binding XPath=@name}" /> </HierarchicalDataTemplate> <CollectionViewSource x:Key="projectView" Source="{StaticResource xmlDP}"> <CollectionViewSource.SortDescriptions> <!-- ADD SORT DESCRIPTION HERE --> </CollectionViewSource.SortDescriptions> </CollectionViewSource> <TreeView Margin="11,79.992,18,19.089" Name="tvProject" BorderThickness="1" FontSize="12" FontFamily="Verdana"> <TreeViewItem ItemsSource="{Binding Source={StaticResource xmlDP}, XPath=*}" Header="Project"/> </TreeView>

    Read the article

  • Confused with an ASP.NET/WCF WSDL Parsing Error

    - by Vaccano
    I have a WCF Web Service that my ASP.NET app uses. It has been working fine for quite some time. I just added in a Dev Express Grid (and the Dev Express DLLs) and a new page that uses them and now I am getting parsing errors on the WSDL. But the weird part is that it works fine on my machine but fails on the web server machine. (Both are connecting to the same web services WSDL.) Here is the error message I am getting: Server Error in '/MyWebAppWebDev' Application. -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Reference.svcmap: Failed to generate code for the service reference 'MyWebAppService'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Referenced type 'WebClientApp.MyWebAppService.ReferenceUpdatesDataContract, WebClientApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'ReferenceUpdatesDataContract' in namespace 'http://schemas.datacontract.org/2004/07/MyWebAppServiceLibrary.DataContracts' cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMyWebAppReferenceDataServiceLib'] Cannot import wsdl:binding Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on. XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IMyWebAppReferenceDataServiceLib'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='MyWebAppServicesDefaultEndpoint'] Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='MyWebAppServicesDefaultEndpoint'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='MyWebAppReferenceDataServiceLib']/wsdl:port[@name='MyWebAppServicesDefaultEndpoint'] Source Error: [No relevant source lines] Source File: /MyWebAppWebDev/App_WebReferences/MyWebAppService/ Line: 1 I am completely stumped on this. I have checked my web.config endpoint address and it is spot on (and notably is not in the error message above). Any ideas would be welcomed.

    Read the article

  • Selenium Testing

    - by Joakim
    Hi I want to get a bunch of dom-objects with xpath and loop through those to check if they contains a specified text, is this possible in the Selenium IDE or rc? Perl is my prefered language XPath would be something like xpath=//tbody[@class='table-data']/tr/td/div[@class='table-item'] This would return all row items in the table, but i need to check each div if contains a specified text string. Is this possible with Selenium? Best regards

    Read the article

  • Traceability with XSD

    - by blastthisinferno
    I am trying to let my XML schema handle a little traceability functionality as I'm gathering requirements while I read through some functional specifications. (Not ideal for requirement management, but at least its a start.) What I'm doing is creating a <functionalSpec tag for each functional specification I am currently reading through. I create a <requirement tag for each requirement I find. Since I want to be able to trace where the requirement came from, I create a <trace element with the id of the <functionalSpec element. Instead of allowing myself to enter any plain-old-text in the <functionalSpecId tag, I want the XSD to validate and make sure that I only enter in an id that exists for an existing functional spec. My problem is coming in where it seems the XML Schema W3C Recommendations documentation says that what I want to do is not possible. (about 1/2 way down) {selector} specifies a restricted XPath ([XPath]) expression relative to instances of the element being declared. This must identify a node set of subordinate elements (i.e. contained within the declared element) to which the constraint applies. I'm using Oxygen to create this since I'm fairly new to XSD files, and it gives me the following error: E [Xerces] Identity Constraint error: identity constraint "KeyRef@1045a2" has a keyref which refers to a key or unique that is out of scope. So my question is does anyone know of a way that will allow me to use the same XML structure that I have below through using XSD? Below is the XML file. <?xml version="1.0" encoding="UTF-8" ?> <srs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="srs req2.xsd" xmlns="srs"> <requirements> <requirement DateCreated="2010-06-11" id="1"> <Text>The system shall...</Text> <trace> <functionalSpecId>B010134</functionalSpecId> </trace> <revisions> <revision date="2010-06-11" num="0"> <description>Initial creation.</description> </revision> </revisions> </requirement> </requirements> <functionalSpecs> <functionalSpec id="B010134" model="Model-T"> <trace> <meeting></meeting> </trace> <revisions> <revision date="2009-07-08" num="0"> <description>Initial creation.</description> </revision> <detailer>Me</detailer> <engineer>Me</engineer> </revisions> </functionalSpec> </functionalSpecs> </srs> Below is the XSD file. <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="srs" xmlns="srs" xmlns:srs="srs" elementFormDefault="qualified"> <!-- SRS --> <xs:element name="srs" type="SRSType"> </xs:element> <xs:complexType name="SRSType"> <xs:sequence> <xs:element ref="requirements" /> <xs:element ref="functionalSpecs" /> </xs:sequence> </xs:complexType> <!-- Requirements --> <xs:element name="requirements" type="RequirementsType"> <xs:unique name="requirementId"> <xs:selector xpath="srs/requirements/requirement" /> <xs:field xpath="@id" /> </xs:unique> </xs:element> <xs:complexType name="RequirementsType"> <xs:choice maxOccurs="unbounded"> <xs:element name="requirement" type="RequirementType" /> </xs:choice> </xs:complexType> <xs:complexType name="RequirementType"> <xs:complexContent> <xs:extension base="RequirementInfo"> <xs:sequence> <xs:element name="trace" type="TraceType" maxOccurs="unbounded" minOccurs="1" /> <xs:element name="revisions" type="RequirementRevisions" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="RequirementRevisions"> <xs:sequence> <xs:element name="revision" type="RevisionInfo" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="RequirementInfo"> <xs:sequence> <xs:element name="Text" type="Description" /> </xs:sequence> <xs:attribute name="DateCreated" type="xs:date" use="required" /> <xs:attribute name="id" type="xs:integer" use="required" /> </xs:complexType> <!-- Functional Specs --> <xs:element name="functionalSpecs" type="FunctionalSpecsType"> <xs:unique name="functionalSpecId"> <xs:selector xpath="srs/functionalSpecs/functionalSpec" /> <xs:field xpath="@id" /> </xs:unique> </xs:element> <xs:complexType name="FunctionalSpecsType"> <xs:choice maxOccurs="unbounded"> <xs:element name="functionalSpec" type="FunctionalSpecType" /> </xs:choice> </xs:complexType> <xs:complexType name="FunctionalSpecType"> <xs:complexContent> <xs:extension base="FunctionalSpecInfo"> <xs:sequence> <xs:element name="trace" type="TraceType" maxOccurs="unbounded" minOccurs="1" /> <xs:element name="revisions" type="FunctionalSpecRevisions" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="FunctionalSpecRevisions"> <xs:sequence> <xs:element name="revision" type="RevisionInfo" minOccurs="1" maxOccurs="unbounded" /> <xs:element name="detailer" type="xs:string" /> <xs:element name="engineer" type="xs:string" /> </xs:sequence> </xs:complexType> <xs:complexType name="FunctionalSpecInfo"> <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="model" type="xs:string" use="required" /> </xs:complexType> <!-- Requirements, Functional Specs --> <xs:complexType name="TraceType"> <xs:choice> <xs:element name="requirementId"> <xs:keyref refer="requirementId" name="requirementIdRef"> <xs:selector xpath="srs/requirements/requirement" /> <xs:field xpath="@id" /> </xs:keyref> </xs:element> <xs:element name="functionalSpecId"> <xs:keyref refer="functionalSpecId" name="functionalSpecIdRef"> <xs:selector xpath="srs/functionalSpecs/functionalSpec" /> <xs:field xpath="@id" /> </xs:keyref> </xs:element> <xs:element name="meeting" /> </xs:choice> </xs:complexType> <!-- Common --> <xs:complexType name="RevisionInfo"> <xs:choice> <xs:element name="description" type="Description" /> </xs:choice> <xs:attribute name="date" type="xs:date" use="required" /> <xs:attribute name="num" type="xs:integer" use="required" /> </xs:complexType> <xs:complexType name="Description" mixed="true"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Date" type="xs:date" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema>

    Read the article

  • Python + Expat: Error on &#0; entities

    - by clacke
    I have written a small function, which uses ElementTree and xpath to extract the text contents of certain elements in an xml file: #!/usr/bin/env python2.5 import doctest from xml.etree import ElementTree from StringIO import StringIO def parse_xml_etree(sin, xpath): """ Takes as input a stream containing XML and an XPath expression. Applies the XPath expression to the XML and returns a generator yielding the text contents of each element returned. >>> parse_xml_etree( ... StringIO('<test><elem1>one</elem1><elem2>two</elem2></test>'), ... '//elem1').next() 'one' >>> parse_xml_etree( ... StringIO('<test><elem1>one</elem1><elem2>two</elem2></test>'), ... '//elem2').next() 'two' >>> parse_xml_etree( ... StringIO('<test><null>&#0;</null><elem3>three</elem3></test>'), ... '//elem2').next() 'three' """ tree = ElementTree.parse(sin) for element in tree.findall(xpath): yield element.text if __name__ == '__main__': doctest.testmod(verbose=True) The third test fails with the following exception: ExpatError: reference to invalid character number: line 1, column 13 Is the � entity illegal XML? Regardless whether it is or not, the files I want to parse contain it, and I need some way to parse them. Any suggestions for another parser than Expat, or settings for Expat, that would allow me to do that?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >