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 8492573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:45:23+00:00 2026-06-10T22:45:23+00:00

I have the following XML file: <layout> <layout-structure> <layout-root id=layout-root> <layout-chunk id=header-text> <layout-leaf xref=lay-1.01/>

  • 0

I have the following XML file:

<layout>
 <layout-structure>
  <layout-root id="layout-root">
    <layout-chunk id="header-text">
         <layout-leaf xref="lay-1.01"/>
         <layout-leaf xref="lay-1.02"/>
    </layout-chunk>
    <layout-leaf xref="lay-1.03"/>
  </layout-root>
  <layout-root id="layout-root-two">
    <layout-chunk id="header-text-two">
     <layout-leaf xref="lay-1.04"/>
     <layout-leaf xref="lay-1.05"/>
     <layout-leaf xref="lay-1.06"/>
    </layout-chunk>
  <layout-leaf xref="lay-1.07"/>
 </layout-root>
</layout-structure>

<realization>
  <text xref="lay-1.01 lay-1.04"/>
  <text xref="lay-1.02 lay-1.05"/>
  <graphics xref="lay-1.03 lay-1.06" type="1"/>
  <graphics xref="lay-1.07" type="2"/>
</realization>
</layout>

I want to extract the values for the xref attribute of the graphics element, in order to limit the output in the for clause of the function shown below.

declare function local:gfx($root, $graphics) {
let $graphic-xrefs := tokenize($graphics/@xref, " ")
for $layout-leafs in $root//layout-leaf[@xref = $graphic-xrefs]
return concat('"', $layout-leafs/@xref, '" ', $dotgraphics, ';', $newline) 
};

This, however, causes an error because some of the xref attributes under the graphics element contain a single value, as in the case of <graphics xref="lay-1.07"/>.

Is it possible to use tokenize to fetch the graphics/xref values, or should I use a different approach?

  • 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-10T22:45:24+00:00Added an answer on June 10, 2026 at 10:45 pm

    You could try changing the way you create $graphic-xrefs…

    declare function local:gfx($root, $graphics) {
        let $graphic-xrefs := 
            for $xref in $graphics/@xref
            return
                tokenize($xref,' ')
        for $layout-leafs in $root//layout-leaf[@xref = $graphic-xrefs]
        return concat('"', $layout-leafs/@xref, '" ', $dotgraphics, ';', $newline) 
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
I have the following XML layout file, HELPME.XML <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have the following text in xml file: <Config Builder=LP Wizard> <Libraries> <Library Name=XCAMSource/>
I have the following xml file <Layout xmlns=http://tempuri.org/Layout/> <Numeric Id=temperature Caption=Temperature> <validation:IsValidWhen xmlns:validation=http://tempuri.org/Validation/> </validation:IsValidWhen>
I have made following relative layout in an xml file lets say add_relative_layout.xml <?xml
I write a simple game with the following structure. Main xml layout have user
I have the following xml file for navigation bar layout: navigation_bar.xml EDIT: I simplified
I have the following layout in my xml file: <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent> <FrameLayout android:id=@+id/logoLayout
I have the following the layout file <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=http://schemas.android.com/apk/res/com.company android:layout_width=fill_parent
I have the following layout file: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:background=#FF0000

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.