如何在basex上打印没有标签的数据?
How to print data without the tag on basex?
我需要在没有标签的情况下显示下面的xquery数据,所以如果你能帮助我,我将不胜感激。你怎么能注意到我已经有了查询。
(: Output the customer names of each pair of customers who are associated with the same
rep. There should not be any duplicate reversed pair and no customer be paired with the
same customer.:)
<result>
{
for $customer1 in doc ("../premiere/Customer.xml")//Customer,
$customer2 in doc ("../premiere/Customer.xml")//Customer
where $customer1/RepNum = $customer2/RepNum and $customer1/CustomerNum < $customer2/CustomerNum
order by $customer1/CustomerName
return
<pair>
"{$customer1/CustomerName}"
"{$customer2/CustomerName}"
</pair>
}
</result>
查询的输出是:
<result>
<pair>
"<CustomerName>Al's Appliance and Sport</CustomerName>"
"<CustomerName>Kline's</CustomerName>"
</pair>
<pair>
"<CustomerName>Al's Appliance and Sport</CustomerName>"
"<CustomerName>All Season</CustomerName>"
</pair>
.
.
.
<pair>
"<CustomerName>The Everything Shop</CustomerName>"
"<CustomerName>Deerfield's Four Seasons</CustomerName>"
</pair>
</result>
我的输出必须是:
<results>
<pair>Al's Appliance and Sport - Kline's</pair>
<pair>Al's Appliance and Sport - All Season</pair>
<pair>Bargains Galore - Johnson's Department Store</pair>
<pair>Brookings Direct - The Everything Shop</pair>
<pair>Brookings Direct - Lee's Sport and Appliance</pair>
<pair>Brookings Direct - Deerfield's Four Seasons</pair>
<pair>Ferguson's - Bargains Galore</pair>
<pair>Ferguson's - Johnson's Department Store</pair>
<pair>Kline's - All Season</pair>
<pair>Lee's Sport and Appliance - Deerfield's Four Seasons</pair>
<pair>The Everything Shop - Lee's Sport and Appliance</pair>
<pair>The Everything Shop - Deerfield's Four Seasons</pair>
</results>
如何删除输出的标签?
而不是
<pair>
"{$customer1/CustomerName}"
"{$customer2/CustomerName}"
</pair>
请尝试以下操作:
<pair>{concat(data($customer1/CustomerName), ' - ', data($customer2/CustomerName))}</pair>
我需要在没有标签的情况下显示下面的xquery数据,所以如果你能帮助我,我将不胜感激。你怎么能注意到我已经有了查询。
(: Output the customer names of each pair of customers who are associated with the same
rep. There should not be any duplicate reversed pair and no customer be paired with the
same customer.:)
<result>
{
for $customer1 in doc ("../premiere/Customer.xml")//Customer,
$customer2 in doc ("../premiere/Customer.xml")//Customer
where $customer1/RepNum = $customer2/RepNum and $customer1/CustomerNum < $customer2/CustomerNum
order by $customer1/CustomerName
return
<pair>
"{$customer1/CustomerName}"
"{$customer2/CustomerName}"
</pair>
}
</result>
查询的输出是:
<result>
<pair>
"<CustomerName>Al's Appliance and Sport</CustomerName>"
"<CustomerName>Kline's</CustomerName>"
</pair>
<pair>
"<CustomerName>Al's Appliance and Sport</CustomerName>"
"<CustomerName>All Season</CustomerName>"
</pair>
.
.
.
<pair>
"<CustomerName>The Everything Shop</CustomerName>"
"<CustomerName>Deerfield's Four Seasons</CustomerName>"
</pair>
</result>
我的输出必须是:
<results>
<pair>Al's Appliance and Sport - Kline's</pair>
<pair>Al's Appliance and Sport - All Season</pair>
<pair>Bargains Galore - Johnson's Department Store</pair>
<pair>Brookings Direct - The Everything Shop</pair>
<pair>Brookings Direct - Lee's Sport and Appliance</pair>
<pair>Brookings Direct - Deerfield's Four Seasons</pair>
<pair>Ferguson's - Bargains Galore</pair>
<pair>Ferguson's - Johnson's Department Store</pair>
<pair>Kline's - All Season</pair>
<pair>Lee's Sport and Appliance - Deerfield's Four Seasons</pair>
<pair>The Everything Shop - Lee's Sport and Appliance</pair>
<pair>The Everything Shop - Deerfield's Four Seasons</pair>
</results>
如何删除输出的标签?
而不是
<pair>
"{$customer1/CustomerName}"
"{$customer2/CustomerName}"
</pair>
请尝试以下操作:
<pair>{concat(data($customer1/CustomerName), ' - ', data($customer2/CustomerName))}</pair>