Topic
3 replies Latest Post - ‏2011-03-28T16:57:36Z by SystemAdmin
dany6883
dany6883
3 Posts
ACCEPTED ANSWER

Pinned topic XPath expression problem

‏2011-03-22T09:55:25Z |
hello I have this xml
<RefPoints xsi:noNamespaceSchemaLocation="PointsOfReference.xsd">
<RefPoint Type="Attraction" LocationCode="a" DirectionFromHotel="North" Longitude="0.0" Name="a"
</RefPoint>
</RefPoints>
how can I define an XPath expression to take the Type attribute from RefPoint?

I have tried in every way

/acm:RefPoints/acm:RefPoint/@acm:Type
acm:RefPoints/RefPoint/@Type
/RefPoints/RefPoint/@Type
RefPoints/RefPoint/Type
acm:RefPoints/acm:RefPoint/@acm:Type

see the attachment to see the entire file and deetails
Thank you
Updated on 2011-03-28T16:57:36Z at 2011-03-28T16:57:36Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    265 Posts
    ACCEPTED ANSWER

    Re: XPath expression problem

    ‏2011-03-22T22:28:15Z  in response to dany6883
    Daniele,

    According to the example you pasted, it should be /RefPoints/RefPoint/@Type. But it might be different if you have multiple instances, or a default namespace declared. Your example isn't enough to tell, as there a <@model/>, which I assume is somehow replaced by something else? Do you have the full document after the replacement?

    Alex
    --
    Orbeon Forms - Web 2.0 Forms, open source, for the Enterprise
    http://www.orbeon.com/
    • dan83
      dan83
      4 Posts
      ACCEPTED ANSWER

      Re: XPath expression problem

      ‏2011-03-25T09:34:13Z  in response to SystemAdmin
      hello Alex,

      thank you for your reply, @model is a macro that according with the url import from database the right xml and so the right instance

      you can imagine that you have the xml imported instead of @model and I'm sure that the xml imported is well formed because I saw it from the log file.

      my problem is, even if I put the right path in the bind element the component with a specified bind they are not shown on the page. I have tried to investigate also in the source code and I found that

      class="xfControl xfInput xfDisabled xfReadWrite xfOptional xfValid

      so I wouldn't that this style class is the reason of why I don't see these component.
      the complete file is attached and you can think that @model will import the xml source:

      <RefPoints xsi:noNamespaceSchemaLocation="PointsOfReference.xsd">

      <RefPoint Type="Attraction" LocationCode="a" DirectionFromHotel="North" Longitude="0.0" Name="a" Rank="1" Description="String" ReferenceCategory="0" DistanceUnit="Kilometers" Latitude="0.0" AttractionCategory="0" Distance="0">
      <Contact StateProv="aa" CountryName="AA" PostalCode="a" City="a" WebsiteURL="String" PhoneNumber="a" StreetAdress="String"/>
      <OperationSchedules>
      <OperationSchedule BeginDate="1967-08-13" EndDate="1967-08-13">
      <OperationTimes>
      <OperationTime Weds="true" BeginTime="2001-12-17T09:30:47.0Z" EndTime="2001-12-17T09:30:47.0Z" Sun="true" Tue="true" Sat="true" Fri="true" Mon="true" Thur="true"/>
      </OperationTimes>
      </OperationSchedule>
      </OperationSchedules>
      </RefPoint>
      </RefPoints>

      Attachments

      • SystemAdmin
        SystemAdmin
        265 Posts
        ACCEPTED ANSWER

        Re: XPath expression problem

        ‏2011-03-28T16:57:36Z  in response to dan83
        Daniele,

        Then for testing, I would replace @model by the actual instance (inline it in the XForms), and see if it works for you. If it still doesn't work, can you include the full file with the instance included (we can't reproduce the issue if the file has a @model). Are the classes you suspect in your source (I don't see them) or in what is being sent to the browser?

        Alex
        --
        Orbeon Forms - Web 2.0 Forms, open source, for the Enterprise
        http://www.orbeon.com/