Answers.Body: <p>You need to be in the correct namespace try</p>
  
  <pre><code>$reader = new \XMLReader();
  </code></pre>
  
  <p>Like <a href="https://craftcms.stackexchange.com/questions/5311/class-craft-stdclass-not-found">here</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-20T19:42:29.833Z
Answers.LastActivityDate: 2018-02-20T19:42:29.833Z
Answers.UserDisplayName: Robin Schambach
Body: <p>In my project, I have a reference to XMLReader in a plugin; however, I get this error message:</p>
  
  <pre><code>Class 'Craft\XMLReader' not found
  </code></pre>
  
  <p>Here is the code which calls it:</p>
  
  <pre><code>$reader = new XMLReader();
  </code></pre>
  
  <p>Can XMLReader be used within Craft, or can there be a customization which would allow it?  Thanks</p>
  
Tags: <plugin-development><php><xml><classes>
Title: Using XMLReader With Plugin
ThreadText: # Using XMLReader With Plugin
  
  (Asked by: username_0 on 2018-02-20)
  
  In my project, I have a reference to XMLReader in a plugin; however, I get this error message:
  
  ```
  Class 'Craft\XMLReader' not found
  
  ```
  
  Here is the code which calls it:
  
  ```
  $reader = new XMLReader();
  
  ```
  
  Can XMLReader be used within Craft, or can there be a customization which would allow it? Thanks
  
  **Tags:** plugin-development, php, xml, classes
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-20. Score: 1
  
  You need to be in the correct namespace try
  
  ```
  $reader = new \XMLReader();
  
  ```
  
  Like [here](https://craftcms.stackexchange.com/questions/5311/class-craft-stdclass-not-found)
  
  
  ---
  
  