1

I'm having an url-pattern like "http://www.asdf.com/pages=1", now I want to operate for loop for this url-pattern upto 1547 i.e., ("http://www.asdf.com/pages=1547")

2 Answers 2

5

This might do what you need:

for $i in (1 to 10, 1547, 1548)
return concat("http://www.asdf.com/pages=", $i)
Sign up to request clarification or add additional context in comments.

6 Comments

Thanks and more query., if the url pattern is like this "asdf.com.?sid=1545148454855&page=1?sid=ABGDBSDGH58569ASDE" , now i have to change this thing?
What about return concat("asdf.com.?sid=1545148454855&page=", $i, "?sid=ABGDBSDGH58569ASDE&q…")?
One more query adn how to replace "?" with "" [Null] in xquery.
You'll have to escape the ampersand characters & as & too, so it should be more like concat(http://www.asdf.com./?sid=1545148454855&page=', $i, '?sid=ABGDBSDGH58569ASDE&q...').
for replacing substrings, please look at fn:replace($string, $pattern, $replacement).
|
3
for $i in (1 to 1547)
return concat("http://www.asdf.com/pages=",$i)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.