Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:53:43+00:00 2026-06-11T13:53:43+00:00

I am performing a query that works without HTML, but when I add HTML,

  • 0

I am performing a query that works without HTML, but when I add HTML, to better organize the results. When I add in <div> and </div> tags, I get an error (see below). Here’s the query:

let $doc := doc('test')  
for $v in $doc//item 
where $v/product_info/unit[.='9291']
return 
  <div>{ $v/seller_info/seller_company_id[position() lt 2]/text() } 
  </div> 
  <div>{ $v/seller_info/seller_rating[position() lt 3]/text() 
  </div>

On this document:

<item>
<item_number>1171270</item_number>
<seller_info>
<seller_company_id>6356</seller_company_id>
<seller_rating>C31</seller_rating>
<seller_rating>T150 hr.</seller_rating>
</seller_info>
<product_info>
<unit>2022</unit>
<sinfo>55 cases</sinfo>
<sinfo>Yu-gi-oh trading card pack</sinfo>
<sinfo>.45kg per unit</sinfo>
<sinfo>24.7500kg shipment</sinfo>
</product_info>
<product_info>
<unit>9291</unit>
<sinfo>7 units</sinfo>
<sinfo>Naruto, Classic, action figure</sinfo>
<sinfo>1.8kg per unit</sinfo>
<sinfo>12.6kg shipment</sinfo>
</product_info>
</item>

And the error I’m getting:

Stopped at line 4, column 85: [XPST0003] Unexpected end of query: ‘>{ $v/seller_in…’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:53:44+00:00Added an answer on June 11, 2026 at 1:53 pm

    When you want to return multiple elements, you will have to wrap them in a sequence. Additionally, you forgot the closing } in the second <div/>.

    let $doc := doc('test')  
    for $v in $doc//item 
    where $v/product_info/unit[.='9291']
    return 
    (
      <div>{ $v/seller_info/seller_company_id[position() lt 2]/text() } 
      </div>,
      <div>{ $v/seller_info/seller_rating[position() lt 3]/text() }
      </div>
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm performing a SQL query from a Java program to get timestamps
I have a Business Objects Web Intelligence report that is performing a distributed query
I have a query that is performing poorly. Server version: 5.1.37-1ubuntu5.1 (Ubuntu) SELECT *
I am performing a query in which I project the query into a business
I am having an issue with an XPath query I'm performing for a Sitecore
I'm performing a superSlice operation on a column family that looks like this: SuperColumn
I have this quite long query that should give me some information about shipments,
I have a webpage that takes 10 minutes to run one query against a
I've found a number of resources that talk about tuning the database server, but
I have a SQL query that's fairly complicated and involves multiple subqueries and unions.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.