• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

XSLTInputSource Xalan - build from String ?

Hi,

could anyone help me the following problem:

It looks that it is impossible to create XSLTInputSource (XALAN C++
implementation) for anything other than file?
Is it true?

I need to read/write from string or from stream for instance but as far as I
see from sources these constructors are not implemented.
Is it possible with XALAN?
or with any other parser MSXML for instance

Could you please provide me with some sample code or point to any
informative source?

Looking for help
Martin
0
martinmoessner
Asked:
martinmoessner
1 Solution
 
jkrCommented:
>>for anything other than file?

There seems to be a misunderstanding - 'istream' does not necessarily have to represent a file, it can be anything that fits an input stream buffer like 'istream', such as e.g. a 'istrstream'- see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang98/HTML/_iostream_input_streams.asp ("Input Streams")

Apart from that: I don't know XALAN, but according to http://xml.apache.org/xalan-c/apidocs/classXSLTInputSource.html , there are a couple of other constructors available, namely

# XSLTInputSource (const XMLCh *systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const XalanDOMString &systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const char *systemId)

    Create a new input source with a system identifier.

# XSLTInputSource (const char *systemId, const char *publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (const XMLCh *systemId, const XMLCh *publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (const XalanDOMString &systemId, const XalanDOMString &publicId)

    Create a new input source with a system identifier and a public identifier.

# XSLTInputSource (XalanNode *node)

    Create a new input source with a DOM node.

# XSLTInputSource (StreamType *stream)

    Create a new input source with std stream.



0
 
_corey_Commented:
Martin,

  They are actually implemented in the source.  What you're seeing is simply no code in the method body.

  However, C++ allows you to initialize variables and inherited class constructors in a comma-separated list before the first method body bracket.  This is the best way I can think to explain it.

  You'll see that XSLTInputSource actually inherits InputSource, so this is calling InputSource's constructor with no parameters.  Then, m_stream and m_node member variables are initialized by the value in the parentheses.  This appears to setup the XSLTInputSource object just fine.

XSLTInputSource::XSLTInputSource(StreamType*      stream) :
      InputSource(),
      m_stream(stream),
      m_node(0)
{
}



XSLTInputSource::XSLTInputSource(StreamType&      stream) :
      InputSource(),
      m_stream(&stream),
      m_node(0)
{
}

corey
0
 
waysideCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: corey

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

wayside
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now