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
This might do what you need:
for $i in (1 to 10, 1547, 1548)
return concat("http://www.asdf.com/pages=", $i)
6 Comments
Siddhu
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?
Jens Erat
What about
return concat("asdf.com.?sid=1545148454855&page=", $i, "?sid=ABGDBSDGH58569ASDE&q…")?Siddhu
One more query adn how to replace "?" with "" [Null] in xquery.
Leo Wörteler
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...').Leo Wörteler
for replacing substrings, please look at
fn:replace($string, $pattern, $replacement). |