[xsde-users] Q: Overriding an optional field (BaseURL)

Rangarajan, Ravi_Sowmian raviraja at qti.qualcomm.com
Mon Jul 14 22:20:20 EDT 2014


Dear Code Synthesis Expert,
I have attached a sample schema file that is used to parse certain XML files. Among that, I have been able to override availablityStartTime field in the parsed/cached copy, say it is pointed to by myMPD ptr. This doesn't change the original file parsed in the disk, rather only the parsed copy is altered.

if (myMPD->availabilityStartTime().present())
{
   myMPD->availabilityStartTime().set(dateTimeDesired);
}

Similarly, I want to change another optional field called BaseURL, which can be present in 4 different places. Unlike availabilityStartTime field, the generated code doesn't show get or set or present functions for BaseURL field. And, the way it is accessed right now is

MPD_2011::MPDtype::BaseURL_sequence &BaseURLseq = myMPD->BaseURL();
MPD_2011::MPDtype::BaseURL_iterator baseUrlIter = BaseURLseq.begin();
if (baseUrlIter != BaseURLseq.end())
{
std::string baseUrlRead = *baseUrlter;
}

I want to override BaseURL field in the parsed copy with customBaseUrl which is an std::string, so that whoever is using this parsed copy can use the same value, customBaseUrl.

Q: What is the best way to get a handle on BaseURL and assign customBaseURL string to the first BaseURL in the sequence (even if there are multiple BaseURL items). Can you pls. give me some sample steps that I can try?

If I do  *baseUrlIter = customBaseUrl, it doesn't like it. If I construct a const ::xml_schema::uri uriOverride (customBaseUrl) and then do the assignment *baseUrlIter = uriOverride, it still doesn't like it either.

Thank you in advance
Ravi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPD2.xsd
Type: text/xml
Size: 17105 bytes
Desc: MPD2.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20140715/49280482/MPD2.bin


More information about the xsde-users mailing list